mirror of
https://github.com/NotAShelf/catApi.git
synced 2024-11-26 08:46:45 +00:00
shorten API paths
This commit is contained in:
parent
07aa9b1242
commit
d7c86e1885
1 changed files with 3 additions and 2 deletions
5
index.js
5
index.js
|
@ -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());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue