Getting started with Express and MongoDB
Basic usage of Express and MongoDB to create a simple REST API. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications. MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.
Installation
- Clone the repository
git clone https://github.com/muame-amr/express-getting-started.git
- Install dependencies
npm install
- Run the server
npm run dev
- Edit HTTP request in
route/route.rest
(Alternatively, you can use other tools like curl & postman)
File Structure
bigger project might have different file structures
models/
- data models & schemasroutes/
- API routes or Endpoints or Resourcesserver.js
- file that starts your web server