Created
December 16, 2021 21:11
-
-
Save rschwabco/7bd0836809d217297ebd50c4963d8ba4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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