diff --git a/backend/README.md b/backend/README.md index c0b811bc..00c8f4f3 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,11 +1,17 @@ # Accord - API + Tested code that brings Accord to life. ![Lines of Code](https://img.shields.io/tokei/lines/github/d-clone/API?color=46828d&style=for-the-badge) > © 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. \ No newline at end of file +## 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. diff --git a/backend/nodemon.json b/backend/nodemon.json new file mode 100644 index 00000000..4983de46 --- /dev/null +++ b/backend/nodemon.json @@ -0,0 +1,4 @@ +{ + "watch": ["app.ts", "src/"], + "ext": "ts, css" +} \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index f8c8310e..bfb87e2c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -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", diff --git a/backend/src/app.ts b/backend/src/app.ts index 7efe5a46..a6a82468 100644 --- a/backend/src/app.ts +++ b/backend/src/app.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 })); \ No newline at end of file +.then(con => log.info(`Connected to database.`, { uri: process.env.MONGO_URI })); \ No newline at end of file