Now / lists the endpoints

This commit is contained in:
Sugui 2023-12-27 17:07:32 +01:00
parent c5e41d6f62
commit bf7961f1ca
2 changed files with 5 additions and 1 deletions

View File

@ -21,8 +21,10 @@
},
"dependencies": {
"@types/express": "^4.17.21",
"@types/express-list-endpoints": "^6.0.3",
"@types/mongoose": "^5.11.97",
"express": "^4.18.2",
"express-list-endpoints": "^6.0.0",
"mongoose": "^8.0.3"
}
}

View File

@ -1,13 +1,15 @@
import express from "express";
import mongoose from "mongoose";
import ImageModel from "./ImageModel";
import listEndpoints from "express-list-endpoints";
export const app = express();
app.use(express.json());
app.get("/", (_, res) => {
res.json({ message: "Blazing fast 🚀" });
const endpoints = listEndpoints(app);
res.json({ endpoints });
});
app.get("/images", async (_, res) => {