mirror of
https://github.com/GithubOrgProjectPiza/server.git
synced 2026-09-04 08:36:10 +02:00
Add tests
This commit is contained in:
Generated
+5300
-4
File diff suppressed because it is too large
Load Diff
+8
-1
@@ -1,11 +1,18 @@
|
||||
import express from "express";
|
||||
const app = express();
|
||||
|
||||
let testRoutes = require('./routes/testrouter.route');
|
||||
app.use("/tests", testRoutes);
|
||||
|
||||
|
||||
|
||||
async function main() {
|
||||
app.get("/", (req, res) => {
|
||||
res.send("Hello World!");
|
||||
});
|
||||
|
||||
app.get("/api/", (req, res) => {
|
||||
res.send(" welcome World running on port 3000");
|
||||
})
|
||||
app.listen(3000, () => {
|
||||
console.log("Server is running on port 3000");
|
||||
});
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Request, Response } from "express";
|
||||
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', (request: Express.Request, response: Response) => {
|
||||
response.status(200).send("Cool test stuff!");
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user