Skip to content

Instantly share code, notes, and snippets.

@nidhi-canopas
Created November 1, 2022 04:12
Show Gist options
  • Save nidhi-canopas/9bd51bf281af7e509094c6e3f9bd5317 to your computer and use it in GitHub Desktop.
Save nidhi-canopas/9bd51bf281af7e509094c6e3f9bd5317 to your computer and use it in GitHub Desktop.
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