Commit 95aa8f07 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add missing header

parent a51ea995
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ The application consists of two parts: A client-side part, written in HTML, CSS
│   ├── 🖼️ rocket.png
│   └── 🖼️ ticker.png
└── 📁 js
    ├── 🔑 .htaccess
    └── 🧩 index.mjs
```

@@ -49,7 +50,7 @@ Static sites can also be nicely (and freely) hosted using [GitLab Pages](https:/

Back to the status page. “Hey now, a status page is definitely dynamic. How should this work with a static website?”, you might wonder, and you wouldn't be mistaken: With an entirely static website, it doesn't (unless you are comfortable with editing the status page manually every time there is an update).

This is why the client side here actually does not contain any data. The JavaScript program `index.mjs` makes HTTPS requests to the server side (which is very dynamic) over an API, which returns the data the program than integrates into the website for displaying in your browser.
This is why the client side here actually does not contain any data. The JavaScript program `index.mjs` makes HTTPS requests to the server side (which is very dynamic) over an API, which returns the data the program than integrates into the website for displaying in your browser. The `.htaccess` file is just there so that the Apache webserver sends the right content type header (`text/javascript`) when sending an `*.mjs` file, otherwise the browser would refuse to interpret it as JavaScript.

### The API

js/.htaccess

0 → 100644
+2 −0
Original line number Diff line number Diff line
# .mjs files are also JavaScript files, but Apache apparently doesn't know that, so we need to tell it that.
AddType text/javascript mjs
 No newline at end of file