mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
32 lines
890 B
JavaScript
32 lines
890 B
JavaScript
const express = require('express');
|
|
|
|
const router = express.Router();
|
|
|
|
//Getting a list of all existing documents
|
|
router.get("/", async(req, res) =>{
|
|
try {
|
|
res.status(200).json({documents: []}); //TODO: array full of the documents names
|
|
} catch (e) {
|
|
res.status(404).send("Documents not found");
|
|
}
|
|
});
|
|
|
|
//Getting a specific document
|
|
router.get("/:id", async(req, res) => {
|
|
try {
|
|
res.status(200).json({dokument_URL: ""}); //TODO: return the specific document
|
|
} catch (e) {
|
|
res.status(404).send("Document not found");
|
|
}
|
|
});
|
|
|
|
//Deleting a specific document
|
|
router.delete("/:id", async(req, res) => {
|
|
try {
|
|
res.status(200).send("Document deleted."); //TODO: delet the specific document
|
|
} catch (e) {
|
|
res.status(500).send("Error trying to delete a document");
|
|
}
|
|
});
|
|
|
|
module.exports = router; |