Skip to content

Instantly share code, notes, and snippets.

@rishi-raj-jain
Created September 9, 2021 11:32
Show Gist options
  • Save rishi-raj-jain/4a4372cf95a82321b25a2ae6f9084454 to your computer and use it in GitHub Desktop.
Save rishi-raj-jain/4a4372cf95a82321b25a2ae6f9084454 to your computer and use it in GitHub Desktop.
const express = require('express')
const app = express()
app.use(express.json())
app.all('/api/some-route/:slug.json', (req, res) => {
const slug = req.params.slug
// some data fetching calls from the slug
res.json({ data: 'data' })
})
module.exports = app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment