Skip to content

Instantly share code, notes, and snippets.

@rschwabco
Created December 16, 2021 21:11
Show Gist options
  • Save rschwabco/7bd0836809d217297ebd50c4963d8ba4 to your computer and use it in GitHub Desktop.
Save rschwabco/7bd0836809d217297ebd50c4963d8ba4 to your computer and use it in GitHub Desktop.
// Enable CORS
app.use(cors());
// Protected API endpoint
app.get("/api/protected", checkJwt, function (req, res) {
//send the response
res.json({
secretMessage: "Here you go, very sensitive information for ya!",
});
});
// Launch the API Server at localhost:8080
app.listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment