This is a basic Node.js application that demonstrates CRUD (Create, Read, Update, Delete) operations. It uses MongoDB as the database and Mongoose ODM for data modeling and interaction. The app is built with the Express framework and renders HTML using Pug templates.
Before running the app, ensure you have the following installed:
- Node.js (https://nodejs.org)
- MongoDB (https://www.mongodb.com). MongoDB Atlas is also fine. This project uses MongoDB Atlas.
- Clone this repository:
git clone https://github.com/adarsh-2425/simple-node-app.git
- Change into the project directory:
cd simple-node-app
- Install dependencies:
npm install
To start the server, run:
npm start
Visit http://localhost:3000
or your hosted address in your browser to access the app.
The app allows you to:
- Create new books with a title, author, genre, and published year.
- Read the list of existing books.
- Update book information.
- Delete books from the collection.
- Node.js
- Express
- MongoDB
- Mongoose
- Pug (formerly known as Jade)
index.js
: Entry point of the application.views/
: Contains Pug templates for rendering HTML.models/
: Defines the Mongoose data model for books.routes/
: Contains Express route handlers.
This project was created as part of a learning exercise and is maintained by Adarsh S.