This commit is contained in:
2023-11-11 20:02:27 +01:00
parent ca1343e223
commit 2e87a3fb0d
5 changed files with 14 additions and 16 deletions

View File

@@ -10,15 +10,11 @@ app.use(express.json());
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
let basedir: string = __dirname + "../../client";
let basedir: string = __dirname + "/../client";
app.use("/", express.static(basedir + "/"));
app.use("/bootstrap", express.static(basedir + "/node_modules/bootstrap/dist/"));
app.use("/bootstrap", express.static(basedir + "/../node_modules/bootstrap/dist/"));
let ranNum: number;
app.get('/', (req, res) => {
res.sendFile(__dirname + 'Aufgabenblatt 3/index.html');
});
app.listen(port, () => {
console.log(`Server gestartet auf http://localhost:${port}/`);
ranNum = random(1, 10);
@@ -55,7 +51,7 @@ app.post('/reset', (req, res) => {
const min: number = Number(req.body.min);
const max: number = Number(req.body.max);
if (Number.isNaN(min || Number.isNaN(max) || min > max || min <= 0 || max <= 0)) {
return res.status(400).send({
return res.status(200).send({
message: 'Invalid input'
})
}