shorten API paths

This commit is contained in:
NotAShelf 2022-01-24 17:54:38 +03:00
parent 07aa9b1242
commit d7c86e1885
No known key found for this signature in database
GPG key ID: 2E4615E792DA9BAA

View file

@ -7,6 +7,7 @@ require('dotenv').config();
const port = process.env.PORT; const port = process.env.PORT;
app.listen(port, () => { app.listen(port, () => {
console.log('App listening at http://localhost:' + port); console.log('App listening at http://localhost:' + port);
console.log('Godspeed, little fella!');
}); });
app.get('/', (req, res) => { app.get('/', (req, res) => {
@ -32,11 +33,11 @@ app.get('/:id', (req, res) => {
} }
}); });
app.get('/api/listimgs', (req, res) => { app.get('/api/list', (req, res) => {
return res.json(getAllImageIds()); return res.json(getAllImageIds());
}); });
app.get('/api/randomimg', (req, res) => { app.get('/api/random', (req, res) => {
return res.json(getRandomImageApi()); return res.json(getRandomImageApi());
}); });