commit | 141e286f3d626191c9daa40c38801dc3f5df57e6 | [log] [tgz] |
---|---|---|
author | Matteo Scandolo <matteo.scandolo@gmail.com> | Tue Jan 10 12:03:40 2017 -0800 |
committer | Matteo Scandolo <matteo.scandolo@gmail.com> | Tue Jan 10 17:00:03 2017 -0800 |
tree | 1dc7dba22300cce2b5545b4f2bb9057df8f2e036 | |
parent | a2af348c8fc55d08cbf5c7c7760c0df6082e5caa [diff] |
Moved XOS to port 9000 for all configurations Change-Id: I8681f87a97d4c2961aea6a41e09d56ff17495612
This is an abstraction layer that provide REST APIs and WebSockets access to XOS.
This software can be executed on your local machine as long as NodeJs is installed.
To start it use: npm install && npm start
Alternatively you can invoke the start script node src/server.js
directly to pass addictional paramenters:
--config mycfg.yml
to specify a different config fileLOG_LEVEL=error|warn|info|debug
to enable different logging level (default is warn
)If you are actively working on this project we suggest you to take a look to nodemon to observe changes in you code and automatically restart the server.
By default the used config is:
default: xos: host: xos port: 9999 redis: host: redis port: 6379 gateway: port: 3000
You can create a file called config.yml
and replace one or more value. You can also have different config files and load them using the --config
flag (see above for usage).
A comprehensive test suite defined using Mocha, Chai and Sinon is provided togheter with the project. To execute existing tests use npm test
, while if you are currently working on it you can execute them in watch mode using npm run test:dev
.
Styleguide are also applied using EsLint, to check style execute npm run lint
.
curl -H "x-csrftoken: TOKEN" -H "cookie: xoscsrftoken=TOKEN;xossessionid=SESSION_ID" 127.0.0.1:3000/api/core/instances/
Socket.io client library will be available at: http://localhost:3000/socket.io/socket.io.js
Remember that redis
in the Frontend config is linked
To start the client: cd spec; browser-sync start --server
redis-cli -h xos.dev # In progress PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"0 - In Progress\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}" # Succes PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"1 - Success\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}" # Error PUBLISH Slice "{\"pk\": 19, \"object\": {\"id\": 19,\"name\": \"mysite_test_redis\", \"backend_status\": \"2 - Error\"}, \"changed_fields\": [\"updated\", \"backend_status\"]}"