Backend: Projects restarts on save
This commit is contained in:
parent
edd10457b5
commit
87356994d3
@ -1,11 +1,17 @@
|
||||
# Accord - API
|
||||
|
||||
Tested code that brings Accord to life.
|
||||
|
||||

|
||||
|
||||
> © All rights reserved. This repo is not (yet) open source, and is awaiting completion.
|
||||
|
||||
## `.env`
|
||||
## Non-Docker Setup .env
|
||||
|
||||
If you are not using Docker, you can use the following template as a guide.
|
||||
|
||||
### `.env`
|
||||
|
||||
```.env
|
||||
API_URL="http://localhost:3000/api"
|
||||
EMAIL_ADDRESS="example@gmail.com"
|
||||
@ -16,4 +22,18 @@ ROOT_ENDPOINT="http://localhost:3000"
|
||||
WEBSITE_URL="http://localhost:4200"
|
||||
```
|
||||
|
||||
> For help on setting up gmail mailing, go here - https://nodemailer.com/usage/using-gmail.
|
||||
## Docker Setup .env
|
||||
|
||||
If you are using Docker, some variables will be substituted by Docker.
|
||||
|
||||
```.env
|
||||
API_URL="http://localhost:3000/api"
|
||||
EMAIL_ADDRESS="example@gmail.com"
|
||||
EMAIL_PASSWORD="google_account_password"
|
||||
MONGO_URI="mongodb://database/accord"
|
||||
PORT=3000
|
||||
ROOT_ENDPOINT="http://localhost:3000"
|
||||
WEBSITE_URL="http://localhost:4200"
|
||||
```
|
||||
|
||||
> For help on setting up gmail, go here - https://nodemailer.com/usage/using-gmail.
|
||||
|
4
backend/nodemon.json
Normal file
4
backend/nodemon.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"watch": ["app.ts", "src/"],
|
||||
"ext": "ts, css"
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
"scripts": {
|
||||
"start": "npm run start:dev",
|
||||
"start:dev": "set NODE_ENV=DEV && ts-node-dev --transpile-only src/app.ts",
|
||||
"start:debug": "nodemon --exec node --inspect=0.0.0.0:9229 --require ts-node/register src/app.ts --ext 'ts,yml' --watch",
|
||||
"start:debug": "nodemon --exec node --inspect=0.0.0.0:9229 --require ts-node/register src/app.ts",
|
||||
"start:prod": "ts-node-transpile-only src/app.ts",
|
||||
"test": "npm run test:unit && npm run test:int",
|
||||
"test:int": "ts-mocha --exit test/e2e/test.ts",
|
||||
|
@ -13,4 +13,4 @@ connect(process.env.MONGO_URI, {
|
||||
serverSelectionTimeoutMS: 0,
|
||||
})
|
||||
.catch(error => log.error(error.message ?? 'Unable to connect to db', { uri: process.env.MONGO_URI }))
|
||||
.then(con => log.info(`Connected to database on PORT ${con['port']}.`, { uri: process.env.MONGO_URI }));
|
||||
.then(con => log.info(`Connected to database.`, { uri: process.env.MONGO_URI }));
|
Loading…
x
Reference in New Issue
Block a user