server.mts 341 B

1234567891011121314
  1. import express from "express";
  2. import { dirname } from "path";
  3. import { fileURLToPath } from "url";
  4. const port = 12121;
  5. const path = dirname(fileURLToPath(import.meta.url));
  6. const app = express();
  7. app.use(express.static(path));
  8. app.listen(port, () => {
  9. console.log(`Listening on: \x1b[34m\x1b[4mhttp://localhost:${port}/\x1b[0m`);
  10. });