From 551190066a4b4827b27a6730d29979490036efd6 Mon Sep 17 00:00:00 2001 From: Artemy Date: Sun, 2 Apr 2023 11:14:52 +0300 Subject: [PATCH] fix: dir creation --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fde14ee..7250bd9 100644 --- a/index.js +++ b/index.js @@ -4,13 +4,16 @@ const bodyParser = require("body-parser"); const isValidNote = require("./note_validator"); const fs = require("fs"); const path = require("path"); - const cryptojs = require("crypto-js"); require("dotenv").config(); const app = express(); +if (!fs.existsSync("./notes")) { + fs.mkdirSync("./notes"); +} + app.use(bodyParser.json()); app.post("/publish", function (req, res) {