Skip to content

Instantly share code, notes, and snippets.

@dimlucas
Created September 1, 2018 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimlucas/32504e20e40bb27fc9ae6ac238e84959 to your computer and use it in GitHub Desktop.
Save dimlucas/32504e20e40bb27fc9ae6ac238e84959 to your computer and use it in GitHub Desktop.
//Assume it's in the same folder const asyncWrapper = require("./async-wrapper");
app.post("/path/to/endpoint", asyncWrapper(async (req, res) => {
//Do something like setting a header
res.setHeader("Content-type", "application/json");
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment