summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-28 07:16:56 +0200
committerRory& <root@rory.gay>2025-05-28 07:16:56 +0200
commite7800727d55f5491ec4d935ab063ee102e7cdf73 (patch)
tree595569fce449cb9d82a8db35e731e68fa006432d /src
parentInitialise modules, add eslint config (diff)
downloadnodejs-final-assignment-e7800727d55f5491ec4d935ab063ee102e7cdf73.tar.xz
Bare minimum express server, fix nix package
Diffstat (limited to 'src')
-rw-r--r--src/api/start.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/start.js b/src/api/start.js
new file mode 100644

index 0000000..9d9c586 --- /dev/null +++ b/src/api/start.js
@@ -0,0 +1,12 @@ +import express from "express"; + +const app = express(); +const PORT = process.env.PORT || 3000; + +app.get("/", (req, res) => { + res.send("Welcome to the API!"); +}); + +app.listen(PORT, () => { + console.log(`Server is running on http://localhost:${PORT}`); +});