changed for exe
This commit is contained in:
Binary file not shown.
1
backend/database/recipes/dfrtg.txt
Normal file
1
backend/database/recipes/dfrtg.txt
Normal file
@@ -0,0 +1 @@
|
||||
dfrg
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cookbook",
|
||||
"version": "1.0.0",
|
||||
"version": "0.4",
|
||||
"main": "server.js",
|
||||
"bin": "server.js",
|
||||
"scripts": {
|
||||
@@ -22,4 +22,4 @@
|
||||
"views/**/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -8,7 +8,7 @@ router.get("/", (req, res) => {
|
||||
|
||||
router.get("/:id", (req, res) => {
|
||||
res.sendFile(
|
||||
`/Gitea_Dus1_REPOS/Cookbook/backend/database/recipes/${req.params.id}.json`
|
||||
`/Gitea_Dus1_REPOS/Cookbook/backend/database/recipes/${req.params.id}.txt`
|
||||
);
|
||||
});
|
||||
|
||||
|
@@ -12,7 +12,6 @@ app.get("/add", (req, res) => {
|
||||
});
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
|
||||
// script to sync recipes
|
||||
const recipesFolder = path.join(__dirname, "database/recipes");
|
||||
fs.readdir(recipesFolder, (err, files) => {
|
||||
@@ -34,7 +33,6 @@ app.get("/", (req, res) => {
|
||||
});
|
||||
|
||||
// script to render in markdown
|
||||
|
||||
});
|
||||
|
||||
// middleware for add recipe
|
||||
@@ -46,12 +44,10 @@ app.post("/add/create-recipe", (req, res) => {
|
||||
const { filename, content } = req.body;
|
||||
|
||||
const directory = path.join(__dirname, "database/recipes");
|
||||
// left out if statement for directory check
|
||||
/*
|
||||
|
||||
if (!fs.existsSync(directory)) {
|
||||
fs.mkdirSync(directory);
|
||||
}
|
||||
*/
|
||||
|
||||
const filePath = path.join(directory, `${filename}.txt`);
|
||||
|
||||
|
Reference in New Issue
Block a user