Skip to content

CodeYouOrg/using-the-no-as-a-service-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using the No as a Service API

Overview

This project demonstrates how to use Express to handle basic CORS errors when making a request to an API that implements CORS.

Unlike the Quote Card Express assignment, this project does not serve a static site on the same port. Instead, we will serve our front-end using the Live Server VS Code extension.

Project Structure

using-the-no-as-a-service-api/
├─ back-end/
│  └─ server.js
|─ js/
|  └─ index.js
├─ .gitignore
├─ index.html
├─ package-lock.json
├─ package.json
└─ README.md

Required Tools

Tools
Node.js
Live Server VS Code extension

Running Locally

  1. If Node.js has not been installed on your computer, please visit https://nodejs.org/en/download to download and installed.
  2. Verify that NodeJS and npm is installed correctly.
    1. In Git Bash, run the following commands: node -v and npm -v
    2. If both commands return a version number, you have successfully installed Node.js
  3. Clone down this project into the directory of your choice.
  4. Open the project in VS Code.
  5. In the integrated terminal, run npm install to install the required packages.
  6. To serve the back-end, run npm run dev in the terminal
  7. Right-click index.html and select Open with Live Server.
  8. index.html will display the "No" reason in the <h1> element.

About

An example of using the No as a Service API and how to handle CORS errors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published