This is the backend for xmeme app made in nodejs using express.js framework
If you want to do the installation, follow these steps:
Clone the repo using ssh:
git clone [email protected]:COHORT_ME_BUILDOUT_XMEME_ENROLL_1612436694845/neelparihar599-me_buildout_xmeme.git
Go into the backend folder using:
cd xmeme_backend
Install the dependencies:
using NPM
npm install
OR
using Yarn
yarn install
Set the environment variables:
cp .env.example .env
# open .env and modify the environment variables (if needed)
Running locally:
yarn dev
Running in production:
yarn start
The environment variables can be found and modified in the .env
file. They come with these default values:
# Port number
PORT=8081
SWAGGER_PORT=8080
# URL of the Mongo DB
MONGODB_URL=mongodb://127.0.0.1:27017/xmeme
src\
|--config\ # Environment variables and configuration related things
|--controllers\ # Route controllers (controller layer)
|--docs\ # Swagger files
|--middlewares\ # Custom express middlewares
|--models\ # Mongoose models (data layer)
|--routes\ # Routes
|--services\ # Business logic (service layer)
|--utils\ # Utility classes and functions
|--validations\ # Request data validation schemas
|--app.js # Express app
|--index.js # App entry point