This project is a simple blog page built using EJS (Embedded JavaScript templating) as the templating engine, with Express.js as the backend framework. The blog page allows users to view, create, and manage blog posts.
- Create Blog Posts: Users can create blog posts with a title and content.
- View Blog Posts: All blog posts are displayed on the home page, with each post linking to its individual detailed page.
- Responsive Design: The page is designed to be responsive for all screen sizes.
- Dynamic Templating: EJS templates allow dynamic rendering of content based on the data provided.
- Backend: Node.js, Express.js
- Templating Engine: EJS (Embedded JavaScript)
- Frontend: HTML, CSS, JavaScript
- Version Control: Git
To set up and run this project locally, follow these steps:
- Node.js (v14+)
- MongoDB (optional, if using a database)
- Git
-
Clone the repository:
git clone https://github.com/your-username/blog-page-ejs.git cd blog-page-ejs
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file at the root of your project and add the following variables:PORT=3000
-
Start the development server:
npm start
-
View the app: Visit
http://localhost:3000
in your browser to view the blog page.
├── views
│ ├── partials
│ │ ├── header.ejs
│ │ ├── footer.ejs
│ ├── pages
│ │ ├── home.ejs
│ │ ├── blog.ejs
├── public
│ ├── css
│ │ └── styles.css
│ └── js
├── routes
│ └── blogRoutes.js
├── app.js
├── package.json
└── README.md