A simple boilerplate for Node RESTful APIs. Still a work in progress.
A brief overview of technologies and tools used in this boilerplate, and how to disable them.
PM2 is a process management tool suitable for Node environments. I'll take you to their own webpage to learn more.
The project's process configuration can be found in the file ecosystem.config.js
.
If you don't want to use PM2, simply ignore/delete this file, as well as the dependency on
the pm2
package:
npm uninstall pm2
Configuration is done using the .env
file. As a best practice, you should avoid including
the .env
file in the git repository (which I've done as well). So I made a .env.sample
file to give you an overview of what environment variables can be set.
To process and set the environemnt variables, we use the generally accepted dotenv
package.
I have used Sequelize as the ORM tool for this boilerplate. After installing it
globally, I intialized sequelize using sequelize init
but changed the default
setup a bit.
-
I have moved the
models
,migrations
, andseeders
directories into thesrc
directory. -
I have moved the
config
directory insidesrc
, renamed the default configuration file tosequelize.js
and made some changes. Check the comments! -
I have created the
.sequelizerc
file which handles the changes in the default setup