asura-tmdb/src/server/index.js

21 lines
425 B
JavaScript
Raw Normal View History

2022-03-15 14:46:24 +01:00
const path = require("path");
const express = require("express");
const app = express();
const port = 3000;
const Match = require("./match.js");
app.listen(port, () => {
console.log(`Listening on port ${port}`)
})
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "public", "index.html"));
});
app.get("/match", (req, res) => {
let match = new Match(1, [1, 2]);
res.send(JSON.stringify(match));
});