Now / lists the endpoints
This commit is contained in:
parent
c5e41d6f62
commit
bf7961f1ca
|
@ -21,8 +21,10 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
|
"@types/express-list-endpoints": "^6.0.3",
|
||||||
"@types/mongoose": "^5.11.97",
|
"@types/mongoose": "^5.11.97",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
|
"express-list-endpoints": "^6.0.0",
|
||||||
"mongoose": "^8.0.3"
|
"mongoose": "^8.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,13 +1,15 @@
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import mongoose from "mongoose";
|
import mongoose from "mongoose";
|
||||||
import ImageModel from "./ImageModel";
|
import ImageModel from "./ImageModel";
|
||||||
|
import listEndpoints from "express-list-endpoints";
|
||||||
|
|
||||||
export const app = express();
|
export const app = express();
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.get("/", (_, res) => {
|
app.get("/", (_, res) => {
|
||||||
res.json({ message: "Blazing fast 🚀" });
|
const endpoints = listEndpoints(app);
|
||||||
|
res.json({ endpoints });
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/images", async (_, res) => {
|
app.get("/images", async (_, res) => {
|
||||||
|
|
Loading…
Reference in New Issue