Giter VIP home page Giter VIP logo

comp-3330-midterm's Introduction

Course Router

The router created by this express server is for capturing our course data in an api format. POSTman lets you GET, POST, PUT, PATCH, and DELETE from this rest API using the given course format. Each course has a date, so with a respective react app, we would be able to sort and categorize these based on that. For now, all we need to see is that we can GET, POST, PUT, PATCH, and DELETE from this rest API properly.

Heroku

The app is hosted as a RESTAPI on: https://comp-3330-midterm.herokuapp.com/

Command Line

The scripts I chose to include in my project today were the start script: "node Server.js", and the dependencies script: "npm i". Because we are not using React, we do not need a build script to bundle the react app before hosting.

RESTAPI

The REST API I created for this midterm deals with courses that include a date for further sorting in a react app. Each course has a time, and with a react front end, we could display these times as tables in a schedule. I used a course Router and the Mongoose Models to create a RESTAPI that reaches out and interacts with the courses db in the mongo atlas. As I said before, these courses would be ready for pulling and sorting into a react app for a schedule.

GET

We use the GET request to pull all of the course data from Mongo.

POST

We use the POST request to add new courses into our course DB

PUT && PATCH

We can use the PUT and PATCH requests similarily to insert new information into a specified course given the ID.

DELETE

We can use the DELETE request to delete from our database the course with the given ID.

ES6 Features

  1. Const from line 8 of Server.js
const courseRouter = express.Router();
  1. Arrow Function from line 17 of Server.js:
.get((req, res) => res.redirect('/api/courses'))
  1. Template literal String from line 67 of Server.js:
Course.replaceOne({"_id": `${req.params.courseId}`}, {
  1. Modules from line 2 of ConnectionString.js:
module.exports = {uri}
  1. Destructuring from line 2 of CourseModel.js:
const {Schema} = mongoose;

comp-3330-midterm's People

Contributors

ryancoll avatar

Watchers

 avatar

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.