Full version of the Model View Controller pattern using Express as Webserver and MongoDB as database driver.
- Routes - Includes all the routes to specific pages with
POST
,GET
,PUT
andDELETE
requests. - Models - All the models and schemas for the database.
- Views - The views HTML files.
- Controllers - When Route endpoint is reached a controller action handles the request.
- Download the repo as .zip or clone it with
git clone https://github.com/ImMoe/express-starter.git
. - Then within the folder you downloaded run
npm install
- Now open
.env
file and change DB_NAME value from YOUR_DB_NAME to your preference. - Now everything is configured and you are ready to start building your site.
- Before deployment if you use Mongo Atlas put connection string into MONGO_ATLAS variable inside .env file.
- After that go inside database folder and open config.js and change
${process.env.DB_HOST}${process.env.DB_NAME}
to${process.env.MONGO_ATLAS}