Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 320c58d0 authored by 65160024's avatar 65160024
Browse files

update server.js

parent f37604a1
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,10 @@ app.use(cors());
// app.use('/api', authRouter)
// app.use('/api', categoryRouter)
readdirSync("./routes").map((c) => app.use("/api", require("./routes/" + c)));
const path = require("path");
readdirSync(path.join(__dirname, "routes")).map((c) =>
app.use("/api", require(path.join(__dirname, "routes", c)))
);
app.listen(3000, () => console.log("server is running on port 3000"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment