Verified Commit 0050989f authored by Mathieu Lirzin's avatar Mathieu Lirzin
Browse files

server: Add entry-point

parent 3e2cac68
......@@ -196,12 +196,32 @@ const explorer = express.static("src/explorer")
| Run! |
`-------*/
/**
* Provide links to the main routes.
*
* @param{Request} req an HTTP request
* @param{Response} res an HTTP response
*/
function entryPoint(req, res) {
res.status(200)
res.send({
api: {
href: "/api/reg",
description: "Web API example to register identifiers"
},
explorer: {
href: "/explorer",
description: "Visualisation of HTTP interactions"
}
})
}
const app = express()
.get('/', entryPoint)
.use('/api', [express.urlencoded({ extended: true }), api])
.use('/spec', [spec])
.use('/explorer', explorer)
app.listen(port, () => {
console.log(`Example app listening at ${base}`)
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment