Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.49 KB

File metadata and controls

43 lines (29 loc) · 1.49 KB

A Simple API

Project Purpose

The goal of this project is to provide a rough example of how to start building your own API. To align with Code:You's Web Development Capstone requirements, we will cover the following topics:

  • Create a route to return:
    • all data and a specific entry in the data by their id
    • post data to the API
  • Persist the data by reading and writing to a JSON file
  • Create a form on the front-end to send POST requests to the API

The code for each lesson exists as its own branch. These branches will contain the solution to that lesson to compare your code against. You can access the lesson pdfs in the lessons directory

If you intend to fork this repository and clone it down to experiment with, keep in mind that you will need to switch to the branch that you want to view as the main branch will be the branch you will default to.

To switch to a branch, run:

git switch <branch-name>

Running Locally

Required Tools

  • VS Code
  • NodeJS
  • npm

In GitBash:

  1. Verify NodeJS and npm are installed on your machine by running node -v and npm -v. If a version number is returned for each command, these have been successfully installed.
  2. cd into your projects directory and run git clone https://github.com/CodeYouOrg/a-simple-api.git
  3. cd into the cloned repo and run npm install to install the required packages.
  4. Open the project with code .
  5. Run the server with npm run dev

Switch to the desired branch using:

git switch <branch-name>