A small Node.js + Express blog application with server-side rendered views using EJS.
- Create, view, edit, and delete blog posts
- Server-side rendered pages with EJS templates
- Bootstrap-based layout and custom styles
- In-memory storage for posts (no database required)
index.js- Main Express application entry pointpackage.json- Node dependencies and package metadatapublic/- Static assetsmain.css- Custom stylinglogo-notepad.png- App logo image
views/- EJS view templatesindex.ejs- Landing/home pageapp.ejs- New blog post formpost_new.ejs- List of published postspost_view.ejs- Single post displaypost_edit.ejs- Edit form for an existing postpartials/- Shared componentsheader.ejs- Header with navigationfooter.ejs- Footer content
- Install dependencies:
npm install- Run the application:
node index.js- Open your browser at:
http://localhost:3000- Visit
/to view the landing page. - Visit
/postto create a new blog post. - After posting, you are redirected to
/post/newwhere all posts are listed. - Use the
Viewbutton to open a post at/post/:id. - Use the
Editbutton to modify a post at/post/:id/edit. - Use the
Deletebutton to remove a post.
- The application stores posts in memory only. Restarting the server clears all posts.
- Post titles are optional; blank titles display as
Untitled. - Post content is required to create or save a post.
- express
- body-parser
- ejs