Backend for homework in Angular course
npm install
npm start
If it started successfully the following message will be shown
{"level":"info","message":"Server started at http://localhost:3000","service":"angular-service"}
To test files uploading, run locally ./files/test.html
. You can use LiveServer or any other tool
Configuration can be done by changing .env
file
You can change server port in SERVER_PORT variable
There are two options to start server: using mock data that is keeped in memory and using database. By default first variant is used.
If you want to use database:
-
Install docker (Docker for Windows or any variant suitable for your OS)
-
Start DB from prebuild image
docker run -p 6379:6379 --name redis-redisjson redislabs/rejson:latest`
you can also run DB in the cloud for free, see more here: https://oss.redis.com/redisjson/#redis-cloud
- Change
DATA_FROM_DB=true
in .env file
-
Start server as usual
-
For initial DB fill run while server is up
npm run fill-db