DEV Community

Cover image for Rest API Boilerplate for Node.js πŸ€–πŸ”₯
webdeasy.de
webdeasy.de

Posted on

Rest API Boilerplate for Node.js πŸ€–πŸ”₯

Are you also tired of writing the same code for every project? πŸ˜”

I am, anyway. That's why I created a Rest API boilerplate for Node.js!

Only 3 simple steps to use them πŸ”₯


Rest API Boilerplate Repo (GitHub)


I know that there are already such boilerplates, however, they are simply much too large and extensive for most purposes.

My boilerplate is as small as possible, but still offers you a meaningful structure for your projects.

Features ⚑

  • Dynamic creation of routes
  • Preinstalled nodemon for faster development
  • REST Client for testing routes
  • 404 Route Handling
  • Simple MySQL Database file
  • Enviroment Variables (.env) for security (API keys, - password,...)
  • Colored error and log messages

How to use πŸ“‘

It could not be simpler:

  1. clone the repository with git clone https://github.com/lorenzhohmann/rest-boilerplate.git
  2. navigate in the directory and execute npm install
  3. Rename _.gitignore to .gitignore

So, if you have ideas for further features or suggestions for improvement: let me know.

If you like what I do, leave me a follow on Twitter and on my web development blog

Until then, happy coding and stay healthy! 😊

Top comments (2)

Collapse
 
khrisl33t profile image
kHRISl33t

That’s the main reason I started using NestJS for most of my projects. These boilerplates are useful, I had a few, but each time I had to setup a new project I had to follow different requirements, so it was already outdated. Not to mention the time you put in to keep the packages up to date. Over time you will find out this approach is simply not worth it. :)
With NestJS I saved quite a lot of time, I can setup
a complex project with everything needed (typescript, linting, testing, typeorm, db schemas, workers, etc...) in less than an hour.

Collapse
 
webdeasy profile image
webdeasy.de

Thanks for your assessment. I don't know NestJS, but will have a look at it now. :)