alberdev / node-api-template

Node API template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodeapitemplate  Logo

Downloads GitHub GitHub release (latest by date) node-current


Simple template for creating a Node.js REST API. This template will help you to develop your own API.


Node API template

Usage

The structure is very simple and easy to maintain. Use models, controllers and routes folders to add more features. Clone this repository and use it. If you feel like contributing, please fork it and send a pull request.

Config

Update config.js with your own parameters to connect to your database and more. Some of features in app.js are commented, if you want to add some of the implemented services (services folder), you should check and uncomment what you need in app.js

Models

You can add your new entities to this folder. Follow versions.model.js example and go on!

Controller

Each controller has a worker, remember this to maintain a clean code.

Routes

Routes are ways that we can handle user navigation to various URLs throughout our application. See routes folder, you can use get, post, put, delete and others in your routes. See a full list of potential routing methods here: Express routing methods

Services

There are many services you can use in your app like send emails, send push notifications, make chat with socket services, crypt service, token managers, image uploader and more...

Remember

All new models and routes must be initialized in your app.js

Author

Alberto Aznar, info@alberdev.com.

Contributing

Feel free to collaborate with ideas 💭, issues ⁉️ and/or pull requests 🔃.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

node-api-template is available under the MIT license. See the LICENSE file for more info.

About

Node API template

License:MIT License


Languages

Language:JavaScript 71.8%Language:HTML 27.5%Language:CSS 0.7%