Skip to content
/ node-api Public template

Node API is the backend service for node-web. It is also a template for Node API applications developed at KTH.

License

Notifications You must be signed in to change notification settings

KTH/node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

269c7d6 · Apr 26, 2025
Apr 17, 2025
Apr 16, 2025
Feb 20, 2024
Nov 8, 2023
Jan 7, 2025
Apr 9, 2025
Apr 17, 2025
Jan 3, 2017
Feb 2, 2022
Dec 22, 2021
Feb 17, 2021
Jun 5, 2023
Aug 29, 2023
Aug 28, 2024
Apr 17, 2025
Aug 31, 2016
Nov 5, 2024
Oct 9, 2023
Nov 8, 2023
Jul 19, 2024
Jul 19, 2024
Jul 19, 2024
Aug 28, 2024
Apr 26, 2025
Apr 26, 2025
Jul 8, 2022
Feb 16, 2021

Repository files navigation

Node API

Description

Node API is the backend service for node-web. It is also a template for Node API applications developed at KTH.

Installation

Install Dependencies

$ npm install

Environment Variables

Sensible 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

Local Databases

Usage

Start the application in local development mode:

$ npm run start-dev

Access the Swagger UI on localhost:3001/api/node/swagger. Authorize with API key set with environment variable API_KEYS. Default value is 1234.

Running Tests

Tests are setup with Jest. Run them with:

$ npm test

Contact

Node API is developed and maintained by Team KTH Web.

About

Node API is the backend service for node-web. It is also a template for Node API applications developed at KTH.

Resources

License

Stars

Watchers

Forks

Packages

No packages published