feat(create-turbo): create kitchen-sink
This commit is contained in:
commit
4625c93980
80 changed files with 11572 additions and 0 deletions
22
apps/api/src/server.ts
Normal file
22
apps/api/src/server.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { json, urlencoded } from "body-parser";
|
||||
import express, { type Express } from "express";
|
||||
import morgan from "morgan";
|
||||
import cors from "cors";
|
||||
|
||||
export const createServer = (): Express => {
|
||||
const app = express();
|
||||
app
|
||||
.disable("x-powered-by")
|
||||
.use(morgan("dev"))
|
||||
.use(urlencoded({ extended: true }))
|
||||
.use(json())
|
||||
.use(cors())
|
||||
.get("/message/:name", (req, res) => {
|
||||
return res.json({ message: `hello ${req.params.name}` });
|
||||
})
|
||||
.get("/status", (_, res) => {
|
||||
return res.json({ ok: true });
|
||||
});
|
||||
|
||||
return app;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue