This repository can be used for building
NODE REST API's using TypeScript on top of Express web framework.
- Repository pattern used to enable separation of concerns
MongoDB- default repository implementation, should be easy to replace
- Install Node.js
- Install MongoDB
- Configure your SMTP service and enter your SMTP settings inside
.env.example
- Clone the repository
git clone --depth=1 https://github.com/eelmogy/user-hobbies <project_name>
- Install dependencies
cd <project_name>
npm install
- Configure your mongoDB server
# create the db directory
sudo mkdir -p /data/db
# give the db correct read/write permissions
sudo chmod 777 /data/db
- Start your mongoDB server (you'll probably want another command prompt)
mongod
- Build and run the project
npm run build
npm start
To access Swagger UI for available endpoints
http://localhost:3000/api-docs/#/
- Before running tests be sure to create a real
.envfile in root using the fields found in.env.example
npm run test