You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
3 years ago | |
---|---|---|
.circleci | 4 years ago | |
src | 3 years ago | |
test | 3 years ago | |
.env.example | 3 years ago | |
.eslintrc.json | 3 years ago | |
.gitignore | 4 years ago | |
.nycrc | 4 years ago | |
.prettierrc | 3 years ago | |
LICENSE | 4 years ago | |
README.md | 3 years ago | |
package-lock.json | 3 years ago | |
package.json | 3 years ago |
README.md
Programma Group REST MongoDB starter files
Comes with:
- ES6 support.
- Mongoose ORM.
- API documentation using Swagger.
- ESLint for code linting.
- Configuration management using dotenv.
- Logging of requests with Winston.
- Tests using Mocha/Chai.
- Coverage report through nyc.
Prerequisites
Setup
Clone the repository, install the dependencies and get started right away.
$ git clone [email protected]:programma-group/starter-mongo.git <application-name>
$ cd <application-name>
$ rm -rf .git
$ npm install
Make a copy of .env.example
as .env
and update your application details and database credentials.
Environment variables description
NODE_ENV
: The node environmentDATABASE
= Mongo Database URL.TEST_DATABASE
: Test Mongo Database URL.PORT
: Application port. If not specified, it defaults to port 7777.TEST_PORT
: Port to run tests.MAIL_HOST
: Host used by nodemailer when it sends an emailMAIL_PORT
: Port used by nodemailer when it sends an emailMAIL_USER
: User used by nodemailer when it sends an emailMAIL_PASSWORD
: Password used by nodemailer when it sends an emailSECRET
: Secret key used to encrypt JWT tokensURL
: The server's URL. Used by swagger docs explorer
This in an example of a .env
file
NODE_ENV=development
DATABASE=mongodb://user:[email protected]:port/database
TEST_DATABASE=mongodb://user:[email protected]:port/database-test
PORT=7777
TEST_PORT=3333
MAIL_HOST=my.host.com
MAIL_PORT=2525
MAIL_USER=myuser
MAIL_PASSWORD=mypassword
SECRET=mysecret
URL=localhost
Starting the application
$ npm run start
Navigate to http://localhost:7777/docs/ to verify the instalation.
Tests
If you have set the test database on the .env file, you can run the tests by using
$ npm run test
Contributing
For contribution and feature requests, please create an issue first.
License
starter-mongo is under MIT License.