Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Harrison committed Jul 27, 2021
1 parent 062f9f7 commit 4e61b75
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions __tests__/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ const SERVER_PORT = process.argv.slice(2)[0] || 9000
// Sets up a fake dependabot-api using json-server
//
// Test it locally by running this script directly:
// $ node __tests__/server/server.js
// Running on http://localhost:9000
//
// $ node __tests__/server/server.js Running on http://localhost:9000
//
// Verify it works: curl http://localhost:9000/update_jobs/1/details
//
// The 'id' attribute is significant for json-server and maps requests tp the
// 'id' key in the db.json for the resource, for example:
//
// - GET /update_jobs/1/details and GET /update_jobs/1 return hard-coded update
// job in db.json
// - GET /update_jobs/2 would 404
// - POST /update_jobs {data: {...attrs}} would persist a new update job with id
// 2

// NOTE: Serialise the response like dependabot-api
router.render = (_, res) => {
Expand Down

0 comments on commit 4e61b75

Please sign in to comment.