cat data mocking
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import * as express from "express";
|
||||
import * as cors from "cors";
|
||||
|
||||
const app: express.Express = express();
|
||||
const port: number = 8000;
|
||||
|
||||
app.get("/", (req: express.Request, res: express.Response) => {
|
||||
app.use(cors());
|
||||
|
||||
app.get("/test", (req: express.Request, res: express.Response) => {
|
||||
console.log(req);
|
||||
res.send("Hello World!");
|
||||
});
|
||||
|
||||
app.post("/test", (req, res) => {
|
||||
res.send({ person: "Test" });
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening at http://localhost:${port}`);
|
||||
});
|
||||
|
Reference in New Issue
Block a user