Skip to content

kkolli/serverside-MEAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Serverside-MEAN - Krishna Kolli

This is a simple file that introduces the server-side MEAN stack. It uses Mongoose to simplify the interaction with Mongo-DB.

Disclaimer

It currently doesn't use Module exports to clean up the code. Using MVC pattern makes it manageable and alot easier to read. My intention with this file is more of a reference guide to write server side code.

What is happening?

In this example, we are creating a simple serverside implementation for a blog. One can GET, POST, UPDATE, DELETE on both posts and comments of those posts. All calls are being passed as JSON.

Routes for Post's

GET /post
POST /post
PUT /post/:id
DELETE /post/:id

Routes for Comments

GET /post/:id/comment
POST /post/:id/comment
PUT/post/:id/comment/:Cid
DELETE /post/:id/comment/:Cid

Sample CURL Commands


curl -X POST http://localhost:3000/post -d "Name=MyLife"
curl -X POST http://localhost:3000/post/5454cbca2853abdcb60196f59f/comment -d "Name=MyFav"
curl -X PUT http://localhost:3000/post/54cbca2853abdcb60196f59f -d "Name=MyLife2"
curl -H "Content-Type: application/json" http://localhost:3000/post

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors