Created
November 1, 2022 04:12
-
-
Save nidhi-canopas/9bd51bf281af7e509094c6e3f9bd5317 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
const express = require('express') | |
const app = express() | |
const cors = require('cors') | |
const port = 3000 | |
app.use(cors( | |
{ | |
exposedHeaders: ['token'], | |
} | |
)) | |
app.get('/ping', (req, res) => { | |
res.header("token", "test token") | |
res.json('Pong!') | |
}) | |
app.listen(port, () => { | |
console.log(`Example app listening on port ${port}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment