serve static

This commit is contained in:
counterweight 2025-02-09 18:47:04 +01:00
parent cd56664442
commit d7ef06b487
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
6 changed files with 9 additions and 3 deletions

View file

@ -15,5 +15,5 @@ Note: I'm assuming you're running Ubuntu 22.04.
## How to run
* You can get the dev containers up and running with `npm run start:containers`.
* You can get the dev containers up and running with `npm run start:containers`. You can visit the app at `localhost`.
* If you would rather only run the express app locally, you can just do `npm run start` instead.

View file

@ -20,6 +20,8 @@ services:
- "80:80"
volumes:
- ./caddy:/etc/caddy
networks:
- app_network
depends_on:
- express

View file

@ -17,10 +17,9 @@
"start": "node src/app.js",
"start:containers": "docker compose up -d --build",
"stop:containers": "docker compose down",
"purge-dev-data": "rm -rf ./container-data",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
}

View file

@ -33,6 +33,8 @@ const apiRoutes = require('./routes/apiRoutes');
app.use('/', webRoutes);
app.use('/api', apiRoutes);
app.use(express.static(path.join(__dirname, 'public')));
app.listen(port, () => {
console.log(`Server started on port ${port}`);
});

BIN
src/public/kitty.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View file

@ -13,6 +13,9 @@
<p>Your session's UUID: <%= uuid %>
</p>
<p id="pubkey-p" style="display:none">And your pubkey is: <span id="pubkey-span"></span></p>
<hr>
<p>Here's a kitty, cause why not</p>
<img width="300px" src="kitty.jpeg" alt="">
</body>
<script>