Git Product home page Git Product logo

edx-nodejs-assignment-2's Introduction

edx Introduction to NodeJS: Assignment 2

This project is my solution to the 2st assignment at edX Introduction to Node.js course.

https://courses.edx.org/courses/course-v1:Microsoft+DEV283x+2T2018/course/

It is a RESTful Express API server with the following endpoints:

  • GET and POST /posts
  • PUT and DELETE /posts/:postId/
  • GET and POST /posts/:postId/comments
  • PUT and DELETE /posts/:postId/comments/commentId

It does server-side validation of input data, respond with proper status code.

Installation

$ git clone https://github.com/gterranova/edx-nodejs-assignment-2.git
$ cd edx-nodejs-assignment-2.git
$ npm i
$ npm run serve

Then you can play with the api at http://localhost:3000

1. Why did I design this project the way I did?

  • I followed the instructions;
  • then, I wanted the comments to be returned along with the posts because they would be shown together with the post they refer to (hence, no actual need of "/posts/.../comments" endpoints, which I kept anyway);
  • I made a draft of front-end to easily play with the API, using knockout which I do not know very well (other solutions, like angular seemed overkilling and a front-end was not even a requirement, so forgive for the poor implementation);
  • All in-memory data manipulation is delegated to the store, which is injected to the request object via middleware.

2. How did I test?

I tested the results with curl, and played with the API via the example front-end.

3. Known issues

  • Everything works as expected;
  • the front-end is not complete, e.g. no authentication, no client-side validation, no error notification on API calls (but at least acts accordingly).

edx-nodejs-assignment-2's People

Contributors

gterranova avatar

Watchers

James Cloos avatar  avatar

Forkers

mani108

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.