basic express setup
This commit is contained in:
commit
549e26f70f
6 changed files with 299 additions and 0 deletions
16
src/index.ts
Normal file
16
src/index.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import express from "express";
|
||||
import path from "path";
|
||||
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000;
|
||||
app.use("/static", express.static(path.join(__dirname, "public")));
|
||||
|
||||
// landing page
|
||||
app.get("/", (req, res) => {
|
||||
res.send("landing page");
|
||||
});
|
||||
|
||||
// start server
|
||||
app.listen(port, () => {
|
||||
console.log(`Running on port ${port}`);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue