mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-23 06:59:29 -07:00
Register v2 proxy API
This commit is contained in:
parent
9ff781a234
commit
a9e69de547
1 changed files with 2 additions and 1 deletions
|
@ -22,12 +22,13 @@ app.use(cors())
|
||||||
app.set('port', process.env.PORT || 3000)
|
app.set('port', process.env.PORT || 3000)
|
||||||
|
|
||||||
app.use('/api/1', require('./api/v1/'))
|
app.use('/api/1', require('./api/v1/'))
|
||||||
|
app.use('/api/2', require('./api/v2/'))
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
return res.status(200).json({ message: 'Available endpoints: /api' })
|
return res.status(200).json({ message: 'Available endpoints: /api' })
|
||||||
})
|
})
|
||||||
app.get('/api', (req, res) => {
|
app.get('/api', (req, res) => {
|
||||||
return res.status(200).json({ message: 'Available API versions: /api/1' })
|
return res.status(200).json({ message: 'Available API versions: /api/1, /api/2' })
|
||||||
})
|
})
|
||||||
app.all('*', (req, res) => {
|
app.all('*', (req, res) => {
|
||||||
return res.status(404).json({ message: 'API endpoint not found' })
|
return res.status(404).json({ message: 'API endpoint not found' })
|
||||||
|
|
Loading…
Reference in a new issue