edit
This commit is contained in:
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user