fix: dir creation

This commit is contained in:
Artemy 2023-04-02 11:14:52 +03:00
parent bff9c3875c
commit 551190066a

View file

@ -4,13 +4,16 @@ const bodyParser = require("body-parser");
const isValidNote = require("./note_validator"); const isValidNote = require("./note_validator");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const cryptojs = require("crypto-js"); const cryptojs = require("crypto-js");
require("dotenv").config(); require("dotenv").config();
const app = express(); const app = express();
if (!fs.existsSync("./notes")) {
fs.mkdirSync("./notes");
}
app.use(bodyParser.json()); app.use(bodyParser.json());
app.post("/publish", function (req, res) { app.post("/publish", function (req, res) {