aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-11-27 15:53:02 +0800
committercrupest <crupest@outlook.com>2022-11-27 15:53:02 +0800
commit4fa1f65c5d099971e94f7f5af4c710fe297d9285 (patch)
tree3de0178b97b26904126056f1010a202fda7a4124
parent2dfc42b9bee216ce966fb1b74d3d7d21e0dcbd81 (diff)
downloadcrupest-4fa1f65c5d099971e94f7f5af4c710fe297d9285.tar.gz
crupest-4fa1f65c5d099971e94f7f5af4c710fe297d9285.tar.bz2
crupest-4fa1f65c5d099971e94f7f5af4c710fe297d9285.zip
Enhance nginx config and www page.
-rw-r--r--docker/crupest-nginx/sites/www/index.html8
-rw-r--r--docker/crupest-nginx/sites/www/src/main.js2
-rw-r--r--docker/crupest-nginx/sites/www/src/style.css8
-rw-r--r--docker/crupest-nginx/sites/www/vite.config.js6
-rw-r--r--template/nginx/root.conf.template4
5 files changed, 21 insertions, 7 deletions
diff --git a/docker/crupest-nginx/sites/www/index.html b/docker/crupest-nginx/sites/www/index.html
index 56089ac..31f3475 100644
--- a/docker/crupest-nginx/sites/www/index.html
+++ b/docker/crupest-nginx/sites/www/index.html
@@ -42,11 +42,11 @@
you build from start. I don't fully test it because I never migrate my data into other server so it might be kind
of buggy. However, it always takes some time to make it your own sites. But don't worry and feel free to contact
me if you run into any issue and I would be glad to help you out.</p>
+ <h2>TODOs of me:</h2>
+ <p id="todo-message">Fetching...</p>
+ <ul id="todo-container">
+ </ul>
</article>
- <h2>TODOs of me:</h2>
- <p id="todo-message">Fetching...</p>
- <ul id="todo-container">
- </ul>
<script type="module" src="/src/main.js"></script>
</body>
diff --git a/docker/crupest-nginx/sites/www/src/main.js b/docker/crupest-nginx/sites/www/src/main.js
index 111b0bd..13a85c3 100644
--- a/docker/crupest-nginx/sites/www/src/main.js
+++ b/docker/crupest-nginx/sites/www/src/main.js
@@ -21,7 +21,7 @@ document.addEventListener("DOMContentLoaded", async () => {
const todoContainer = document.getElementById("todo-container");
const res = await fetch("/api/todos");
- const body = res.json();
+ const body = await res.json();
if (res.status !== 200) {
todoMessage.style.color = "red";
diff --git a/docker/crupest-nginx/sites/www/src/style.css b/docker/crupest-nginx/sites/www/src/style.css
index 6021c6c..b632745 100644
--- a/docker/crupest-nginx/sites/www/src/style.css
+++ b/docker/crupest-nginx/sites/www/src/style.css
@@ -5,7 +5,13 @@ html {
body {
width: 100%;
margin: 0;
- padding: 0 2em;
+ box-sizing: border-box;
+}
+
+@media (min-width: 576px) {
+ #main-article {
+ padding: 0 2em;
+ }
}
#color-strip-container {
diff --git a/docker/crupest-nginx/sites/www/vite.config.js b/docker/crupest-nginx/sites/www/vite.config.js
new file mode 100644
index 0000000..1386040
--- /dev/null
+++ b/docker/crupest-nginx/sites/www/vite.config.js
@@ -0,0 +1,6 @@
+/** @type {import('vite').UserConfig} */
+export default {
+ build: {
+ sourcemap: true
+ }
+}
diff --git a/template/nginx/root.conf.template b/template/nginx/root.conf.template
index d1cbb45..dfedc81 100644
--- a/template/nginx/root.conf.template
+++ b/template/nginx/root.conf.template
@@ -7,7 +7,9 @@ server {
listen [::]:443 ssl http2;
server_name ${CRUPEST_DOMAIN};
- root /srv/www;
+ location / {
+ root /srv/www;
+ }
location /api {
proxy_http_version 1.1;