I am currently working on creating an express route that allows me to input an equity name as a query parameter by using ?symbol=
in the URL. Once the equity name is provided, I intend to include a new route after that.
const express = require("express")
const app = express()
app.get("/api/v1/equity/latest", (req, res) => {
res.send(req.query)
})
app.listen (3000, () => {
console.log("listening on port 3000")
})
When I send a GET request to the URL
localhost:3000/api/v1/equity?symbol=BBNI/latest/
and examine the received queries, it shows symbol = BBNI/latest/
I am wondering how I can effectively separate the symbol query from the subsequent /latest
route?