Skip to content

A basic API access point written in Node JS using Express, an app that sends stored data when recieving a web request.

License

Notifications You must be signed in to change notification settings

ElenaChes/Express-Js-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API app example

A basic API access point written in Node JS using Express.
Description: an app that sends stored data when recieving a web request.

Content


Installation

  1. Replace the mock data in data.json with your data.
  2. Run npm i.
  3. Start index.js.

Behaviour

  1. A user accesses the /api path of the app. (for example http://localhost:8080/api)
  2. The app sends the data from data.json to the user in JSON format.

Usage Ideas

  • Check for a key or authentication password in the parameters of the url to limit access to the API.
  • Add more paths based on your needs. (Might need to move the route handling (router.get) to separate files or folders)
  • Add more JSON files based on your needs, or store data in variables as needed.

Tip

For an example of a full API app with multiple paths, parameters, files and folders feel free to check out my Url shortener.

About

A basic API access point written in Node JS using Express, an app that sends stored data when recieving a web request.

Topics

Resources

License

Stars

Watchers

Forks