Initialized users route
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import express from "express";
|
||||
import dotenv from "dotenv";
|
||||
dotenv.config();
|
||||
import cors from "cors";
|
||||
|
||||
// Routes
|
||||
import usersRoute from "./routes/users.js";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const app = express();
|
||||
let PORT = process.env.APP_PORT;
|
||||
|
||||
@@ -12,10 +16,14 @@ app.use(
|
||||
})
|
||||
);
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
res.send("Hello from Express!");
|
||||
res.send("Welcome to ecoconnect.");
|
||||
});
|
||||
|
||||
app.use("/users", usersRoute);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Express server running at http://localhost:${PORT}/`);
|
||||
console.log(`ecoconnect server running at http://localhost:${PORT}/`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user