/express-mvc

MVC Architectural Pattern built with express, mongo and ejs

Primary LanguageEJS

MVC in Express

MVC Architectural Pattern built with express, mongo and ejs as a template engine.

Description

The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.

Getting Started

Firstly, clone this repository to your local machine.

git clone https://github.com/notwld/express-mvc

Install all the dependencies using,

npm i

Create an .env file and define database's URI and application's Port.

URI=(your connection string)
PORT=3000

Finally run your application using,

npm start

API Reference

GET all Vehicles

  GET /

Create Vehicle

  POST /save
Parameter Type Description
v_type string Required. Vehicle Type
description string Required. Vehicle Description
model string Required. Vehicle Model
engine string Required. Vehicle Engine
color string Required. Vehicle Color

Update Vehicle

  POST /update/:id
Parameter Type Description
id string Required. Vehicle Id
edit_v_type string Required. Vehicle Type
edit_description string Required. Vehicle Description
edit_model string Required. Vehicle Model
edit_engine string Required. Vehicle Engine
edit_color string Required. Vehicle Color

Delete Vehicle

 DELETE /delete/:id
Parameter Type Description
id string Required. Vehicle Id

GET Vehicle

 GET /vehicle/:id
Parameter Type Description
id string Required. Vehicle Id