Node API is the backend service for node-web. It is also a template for Node API applications developed at KTH.
$ npm installSensible defaults are set and the application can run locally with an empty .env file.
| Name | Description | Default Value | 
|---|---|---|
| API_KEYS | Configuration for access to API; string with name, key, and scope | ?name=devClient&apiKey=1234&scope=write&scope=read | 
| LOGGING_ACCESS_LOG | Enables or disabled application access log, used by dependency kth-node-access-log | true | 
| LOGGING_LEVEL | Application logging level, used by dependency @kth/log | debug | 
| MONGODB_URI | Document database connection string | mongodb://127.0.0.1:27017/node | 
| SERVER_PORT | The HTTP server port | 3001 | 
| SERVICE_PUBLISH | Root path for the application | /api/node | 
- It is recommended to use a local document database with kth-node-backend
Start the application in local development mode:
$ npm run start-devAccess the Swagger UI on localhost:3001/api/node/swagger. Authorize with API key set with environment variable API_KEYS. Default value is 1234.
Tests are setup with Jest. Run them with:
$ npm test
Node API is developed and maintained by Team KTH Web.