Skip to content

Instantly share code, notes, and snippets.

@christopherbauer
Last active July 1, 2023 17:34
Show Gist options
  • Save christopherbauer/daba6f88db5cae7d56800080c73426a2 to your computer and use it in GitHub Desktop.
Save christopherbauer/daba6f88db5cae7d56800080c73426a2 to your computer and use it in GitHub Desktop.
import express, { Express, Request, Response } from "express";
import dotenv from "dotenv";
import userRouter from "./user";
dotenv.config();
const app: Express = express();
const port = process.env.PORT || 3000;
app.use(json());
app.get("/", (req: Request, res: Response) => {
res.send("Zapatos playground!");
});
app.use("/user", userRouter);
console.log(`⚡️[server]: Server starting up`);
app.listen(port, () => {
console.log(`⚡️[server]: Server is running at http://localhost:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment