17 lines
369 B
JavaScript
17 lines
369 B
JavaScript
const express = require("express");
|
|
const app = express();
|
|
const apiRoutes = require("routes");
|
|
|
|
app.use(express.json());
|
|
app.use(express.urlencoded({ extended: true }));
|
|
|
|
app.use("/api", apiRoutes);
|
|
|
|
app.use("*", (req, res) => {
|
|
res.status(404).json({ error: "Resource not found" });
|
|
});
|
|
|
|
app.listen(3000, () => {
|
|
console.log("Suggestion Service API is up!");
|
|
});
|