summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-03-19 21:43:10 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-03-19 21:49:45 +1100
commit240076a5d8ea85dd9c235fd0a1f5bbaed6b55c6e (patch)
tree0d239c89be66d8ec9613e37194e547de5e537c1c
parentFix UserSettings relation being in `select` rather than `relations` (diff)
downloadserver-240076a5d8ea85dd9c235fd0a1f5bbaed6b55c6e.tar.xz
Add basic information page to /
-rw-r--r--assets/public/index.html64
-rw-r--r--src/api/Server.ts11
2 files changed, 75 insertions, 0 deletions
diff --git a/assets/public/index.html b/assets/public/index.html
new file mode 100644

index 00000000..2fa07ca9 --- /dev/null +++ b/assets/public/index.html
@@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Fosscord Server</title> + + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" rel="stylesheet"> + + <style> + body { + font-family: 'Montserrat', sans-serif; + background-color: rgb(10, 10, 10); + color: white; + font-size: 1.1rem; + height: 100vh; + } + + * { + padding: 0; + margin: 0; + } + + p { + margin-top: 10px; + } + + .container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + margin: 0 40px 0 40px; + height: 100%; + } + + #wordmark { + width: min(500px, 50%); + } + + a, a:visited { + color: #FF6D2E; + } + </style> +</head> + +<body> + <div class="container"> + <img alt="Fosscord Logo" + id="wordmark" + src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets-rebrand/svg/Fosscord-Wordmark-Gradient.svg" /> + + <h1>Welcome!</h1> + <p>If you're viewing this page, that means you've successfully set up your very own Fosscord instance!</p> + <p>For information on how to configure your shiny new setup, you should visit <a href="https://docs.fosscord.com">our documentation</a></p> + <p>For information on how to connect and use your instance, <a href="https://docs.fosscord.com/setup/clients">click here</a></p> + </div> +</body> + +</html> \ No newline at end of file diff --git a/src/api/Server.ts b/src/api/Server.ts
index 49229494..dbe61444 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts
@@ -38,6 +38,15 @@ import { ErrorHandler } from "./middlewares/ErrorHandler"; import { initRateLimits } from "./middlewares/RateLimit"; import { initTranslation } from "./middlewares/Translation"; import { initInstance } from "./util/handlers/Instance"; +import express from "express"; + +const PUBLIC_ASSETS_FOLDER = path.join( + __dirname, + "..", + "..", + "assets", + "public", +); export type FosscordServerOptions = ServerOptions; @@ -126,6 +135,8 @@ export class FosscordServer extends Server { app.use("/api/v9", api); app.use("/api", api); // allow unversioned requests + app.get("/", express.static(PUBLIC_ASSETS_FOLDER)); + this.app.use(ErrorHandler); Sentry.errorHandler(this.app);