Created
June 7, 2022 12:49
-
-
Save emilhein/a257c3e27ade47b79e39a98d9931df56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import path from "path"; | |
import cookieParser from "cookie-parser"; | |
const cors = require('cors'); | |
let app = express(); | |
app.use(cors()); | |
app.use(express.json()); | |
app.use(express.urlencoded({ extended: false })); | |
app.use(cookieParser()); | |
app.use(express.static(path.join(__dirname, "../public"))); | |
app.use("/our_script", (req, res, next) => | |
res.sendFile(path.join(__dirname, "../lib/out.js"), { maxAge: 300000 }) | |
); | |
app.use(express.static(path.join(__dirname, "public"))); | |
export default app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment