Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blavikensbutcher/node-rest-api

Contact books w/ Express, MongoDb, Auth, Jwt, Email sending, Avatars, Favorites
https://github.com/blavikensbutcher/node-rest-api

email-sender express expressjs gravatar-api jwt-authentication mongodb

Last synced: 9 days ago
JSON representation

Contact books w/ Express, MongoDb, Auth, Jwt, Email sending, Avatars, Favorites

Awesome Lists containing this project

README

        

# Node.js microservice template
This template has been created to develop microservices using Node.js with the same structure and default configuration.

### Global variables
* `NODE_ENV` - application environment (usually `development` or `production`)
* `PORT` - the port that the server is listening to
* `MAIL_PASSWORD` - password for email service to send mails
* `MAIL_USER` - email user to send mails `("[email protected]")`

### The scripts from package.json
`npm start` - to run server using node
`npm run dev` - to run server using nodemon

### Docker
* To run docker container:
`docker run -p 8080:3000 -d service-name`

### The structure of the template

**.env.example** - the example of the `.env` file that contains global variables of the service. `.env.example` should be without production data. Should be in GIT;
**.env** - the copied file of `.env.example` with real data of variables. Should be excluded from GIT;
**.gitignore** - patterns of files or folders to ignore checking git changes;
**server.js** - the file to start the service.
**package.json** - the main file of information, and configuration, and dependencies of the service;
**package-lock.json** - the file from `package.json` that contains all information about all node modules that were installed like dependencies and
devDependencies;