Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

danl-basic-http-listener

Requirements

  • Node.js >= 16

How to run

  1. Open command line to repo root
  2. Run npm install
  3. Run npm start

How to add endpoints

Add a new function to index.ts:

app.post("/my-url-goes-here", (request, response) => {
	// do stuff with the request
	console.log(request.body);

	// do stuff with the response
	response.send(200, {success: "true"})
});
  • use app.METHOD (e.g. app.get, app.post)
  • request is an object containing details about the request
  • response exposes methods and data for the response

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages