HacktivPress

A simple blog aplication with Express.js, MongoDB and Vue.js

Setup

  1. Install server dependencies
  cd server
  npm install
  1. Run MongoDB service
  sudo service mongod start
  1. Run Express
  npm start
  1. Install client dependencies
  cd client
  npm install
  1. Run Vue Dev Server
  npm run dev

API Routes

Users

Route Method Usage Result
/api/signup POST Send url-encoded-form with username and password as attributes Created user
/api/signin POST Send url-encoded-form with username and password Token with user data (id and username)

Articles

Route Method Usage Result
/api/articles POST Insert user token to header with token attribute, and url-encoded-form with title, content and category Created articles
/api/articles GET Just send request All articles created
/api/articles/:id GET Replace :id with article id Get one article
/api/articles/:id PUT Replace :id with article id, and url-encoded-form with title, content and category Updated article
/api/articles/:id DELETE Replace :id with article id Affected article