-
Notifications
You must be signed in to change notification settings - Fork 7
General Information
nodejs, typscript, docker, docker-compose, mysql.
- Configure the environmental variables in docker-compose.yml.
- Run npm run docker-run.
- API requests can be sent to 0.0.0.0:3000.
- To get the first admin token, send a POST request to 0.0.0.0:3000/token with the following JSON { "userName": "admin", "pssword": "admin" }.
- After downloading the project, rename sample.env to .env.
- Configure the options in .env.
- Run npm install.
- Run npm run watch-node.
- API requests can be sent to 127.0.0.1:3000.
- To get the first admin token, send a POST request to 127.0.0.1:3000/token with the following JSON { "userName": "admin", "pssword": "admin" }.
HTTP requests are authorised via bearer tokens. After a token has been obtained through a POST request to the /token path, it has to be included as a bearer token in the headers of subsequent requests. For examples of how to do this via CURL requests, refer to the sections on sending requests to specific routes.
Two KNEX configurations are available. They only differ in database seeds. Schemas and connection parameters are identical between the two configurations.
This configuration seeds the database with example users, accounts, and transactions, as well as the initial Admin user and equity account entries. It is the default when running tests or an instance of the app locally. It can be switched to the production configuration by changing the value of NODE_ENV in .env to production.
This configuration seeds the database with only the initial Admin user and equity account entries. It is the default when running continuous integration tests or building a docker image. It can be switched to the development configuration by changing the value of NODE_ENV in the respective yaml files to development.