Kickstart your API Development.
After having to write several variations of this code for several different projects, I decided to create a base repo to accelerate future developments.
Leaving it Open Source to give back to the community!
🎫 - JSON Web Tokens for auth
⚖️ - Data validation with express-validator
🗺️ - i18n error messages (en_US & es_MX) with node-polyglot
📬 - Sendgrid mailer for forgot-password emails
🔐 - Basic security with Helmet
🗒️ - Requests logging with Morgan
☕ - Testing with chai
⏮️ - Babel transpilation: ES6 => ES5 (ready for Heroku deployment!)
🌿 - Seeder starter with mongo-seeding
🗣️ - Custom error logs
Check out guide for a more thorough reading, or jump straight ahead for more concise instructions.
Clone the repo, then install dependencies:
git clone https://github.com/israelmuca/api-starter-node-jwt-mongo.git myproject
cd myproject
npm i
Then, change the .env.example
to .env
. Also, make sure you're running mongod
.
Run the API:
npm run dev
Now, you can try the automated testing; On another terminal execute:
npm run test
This will run the seeder and the tests.
The code is well documented, and a more thorough blog post will be made shortly. In the mean time, if you have any questions, don't hesitate and create a GitHub issue or send me a tweet.