Front-end: HTML, CSS, Bootstrap(CSS-framework), EJS templating
Back-end: NodeJS, ExpressJS(NodeJS framework)
Database:MongoDB, mongoose(JS library for MongoDB)
blogSchema={
title
content
visibility
}
userSchema={
username
password
[blogSchema]
}
Endpoints | Description | Acceptable values | Method |
---|---|---|---|
/ | homepage | GET | |
/register | add a new user to db | POST | |
/login | check for existing user to login | POST | |
/:username | view blogs posted publicly by a username | username | GET |
/:userId/blogs | view all the users from db | userId | GET |
/:userId/myblogs | view all the blogs posted by the loggedin user | userId | GET |
/:userId/compose | create a blog | userId,blogId | POST |
/:userId/:blogId/edit | edit a blog by id | userId,blogId | POST |
/:userId/:blogId/del | delete a blog by id | userId,blogId | POST |
/:userId/:blogId/visibility/:visibility | toggle a private blog to public and vice-versa | userId,blogId,visibility | POST |
**userId corresponds to the loggedin user
git clone [email protected]:thedumbsloth/blogsway.git
cd blogsway/
npm i
node app.js
Alternatively running npx nodemon
instead of node app.js
will automatically restart the node application when file changes in the directory are detected.
open http://localhost:3000/ in your browser