Coder Social home page Coder Social logo

qs-backend's Introduction

README

This is a simple RESTful API, QS-Express, which represents my introduction and first attempt creating a backend using Node.js and Express.

  • Node version: 6.9.2

  • Express version: 1.0.0

  • System dependencies: This app requires postgresql as a database. All other dependencies are listed in package.json and can be loaded onto your machine by cloning this repo and running npm install from the command line.

  • Database Configuration: once you have cloned the repo and updated for all packages, you will have to set up the database on your local machine. To do this, please run the following commands from your terminal in order:
    npm install knex -g (this will give you global access to the knex keyword from the command line) knex migrate:latest (this will create the database needed to run the project from the migrations)
    knex seed:run (this will load fake seed data into the database for each model)

  • How to run the program from your local browser: if you would like to run the program from your browser, please type npm start into the terminal and then open up a browser of your choice and type in the following basic URL localhost:3000 or http://127.0.0.1:3000. The app is up in production on heroku and available at https://qs-backend.herokuapp.com

  • The following extra paths are also available from localhost or from production on heroku:

Database Endpoints

/api/foods returns a list of all foods in the database
/api/foods/:id returns a specific food from the database by id number
/api/foods/edit/:id edit a food from the database

API Functionality

  • The API also accepts POST requests to /api/foods to add new foods into the database and DELETE requests to /api/foods/:id to remove a food from the database.

qs-backend's People

Contributors

akintner avatar

Watchers

James Cloos avatar  avatar

qs-backend's Issues

Feedback

  • LOVE that you refactored into controllers ๐Ÿ‘
  • In your models directory, I suggest naming the file food.js probably to more accurately describe what's going on in the file.
  • The code you got working is really solid and nicely refactored, but I think it's really important to connect your frontend with your backend so whenever you have time (even if it's post-Turing), I highly suggest you dive into this!
  • That error usually occurs when you are trying to set something in the header after you return the response - we can dive into this if you'd like ๐ŸŽ‰

@akintner

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.