Skip to content

A simple demo for the Web Development pathway that walks through the bare basics of creating an API and persisting data to a JSON file.

Notifications You must be signed in to change notification settings

CodeYouOrg/a-simple-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A simple demo for the Web Development pathway that walks through the bare basics of creating an API and persisting data to a JSON file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published