From 8ac37b3d9cf9f089090b63722d272b2fc96fd91e Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Tue, 12 Apr 2022 12:14:34 -0700 Subject: [PATCH] doc: create a public directory --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index cc23cd5..acf6582 100644 --- a/index.js +++ b/index.js @@ -22,6 +22,10 @@ app.use(cors()); // Use middleware to connect app.use("/api", ncovRoute); +// Create a public directory +const __dirname = path.resolve(); +app.use(express.static(path.join(__dirname, "./public"))); + // Setup body parser app.use(bodyParser.json({ limit: "30mb", extended: true })); app.use(bodyParser.urlencoded({ limit: "30mb", extended: true }));