Compare commits

...

4 Commits

Author SHA1 Message Date
20fb3cd685 Update dependency svelte to v5.25.7 2025-04-05 17:03:22 +00:00
ngn
4eb5ad6ef3
add _version to easily access app/api version
All checks were successful
Build the docker image for the frontend application / build (push) Successful in 57s
Build the docker image for the doc server / build (push) Successful in 10s
Signed-off-by: ngn <ngn@ngn.tf>
2025-04-05 19:52:51 +03:00
ngn
bac570615e
bump frontend version
Signed-off-by: ngn <ngn@ngn.tf>
2025-04-05 19:40:29 +03:00
ngn
037a4405b9
fix service info, update images, add meta tags
Signed-off-by: ngn <ngn@ngn.tf>
2025-04-05 19:39:10 +03:00
25 changed files with 138 additions and 201 deletions

37
app/package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "website", "name": "website",
"version": "6.0", "version": "6.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "website", "name": "website",
"version": "6.0", "version": "6.1",
"dependencies": { "dependencies": {
"dompurify": "^3.2.3", "dompurify": "^3.2.3",
"marked": "^15.0.6", "marked": "^15.0.6",
@ -831,6 +831,15 @@
"win32" "win32"
] ]
}, },
"node_modules/@sveltejs/acorn-typescript": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz",
"integrity": "sha512-IwQk4yfwLdibDlrXVE04jTZYlLnwsTT2PIOQQGNLWfjavGifnk1JD1LcZjZaBTRcxZu2FfPfNLOE04DSu9lqtQ==",
"license": "MIT",
"peerDependencies": {
"acorn": "^8.9.0"
}
},
"node_modules/@sveltejs/adapter-auto": { "node_modules/@sveltejs/adapter-auto": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-auto/-/adapter-auto-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/adapter-auto/-/adapter-auto-4.0.0.tgz",
@ -967,14 +976,6 @@
"node": ">=0.4.0" "node": ">=0.4.0"
} }
}, },
"node_modules/acorn-typescript": {
"version": "1.4.13",
"resolved": "https://registry.npmjs.org/acorn-typescript/-/acorn-typescript-1.4.13.tgz",
"integrity": "sha512-xsc9Xv0xlVfwp2o7sQ+GCQ1PgbkdcpWdTzrwXxO3xDMTAywVS3oXVOcOHuRjAPkS4P9b+yc/qNF15460v+jp4Q==",
"peerDependencies": {
"acorn": ">=8.9.0"
}
},
"node_modules/aria-query": { "node_modules/aria-query": {
"version": "5.3.2", "version": "5.3.2",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
@ -1203,9 +1204,9 @@
} }
}, },
"node_modules/esrap": { "node_modules/esrap": {
"version": "1.4.3", "version": "1.4.6",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.3.tgz", "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.6.tgz",
"integrity": "sha512-Xddc1RsoFJ4z9nR7W7BFaEPIp4UXoeQ0+077UdWLxbafMQFyU79sQJMk7kxNgRwQ9/aVgaKacCHC2pUACGwmYw==", "integrity": "sha512-F/D2mADJ9SHY3IwksD4DAXjTt7qt7GWUf3/8RhCNWmC/67tyb55dpimHmy7EplakFaflV0R/PC+fdSPqrRHAQw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15" "@jridgewell/sourcemap-codec": "^1.4.15"
@ -1660,21 +1661,21 @@
} }
}, },
"node_modules/svelte": { "node_modules/svelte": {
"version": "5.19.10", "version": "5.25.7",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.19.10.tgz", "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.25.7.tgz",
"integrity": "sha512-7lId+z36IZWzuo0N0oGOStEPi3/Wv1VQEnIzMmDaLDSlJSruKplhhVr+NaZ0Wh7ZILfOjbeU7PbTjqmQQYZF4A==", "integrity": "sha512-0fzXbXaKfSvFUs6Wxev2h4CoEhexZotbTF9EJ4+Cg7MHW64ZnZ9+xUedZyEpgj0Tt9HrYGv9aASHkqjn9b/cPw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.3.0", "@ampproject/remapping": "^2.3.0",
"@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/sourcemap-codec": "^1.5.0",
"@sveltejs/acorn-typescript": "^1.0.5",
"@types/estree": "^1.0.5", "@types/estree": "^1.0.5",
"acorn": "^8.12.1", "acorn": "^8.12.1",
"acorn-typescript": "^1.4.13",
"aria-query": "^5.3.1", "aria-query": "^5.3.1",
"axobject-query": "^4.1.0", "axobject-query": "^4.1.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"esm-env": "^1.2.1", "esm-env": "^1.2.1",
"esrap": "^1.4.3", "esrap": "^1.4.6",
"is-reference": "^3.0.3", "is-reference": "^3.0.3",
"locate-character": "^3.0.0", "locate-character": "^3.0.0",
"magic-string": "^0.30.11", "magic-string": "^0.30.11",

View File

@ -1,6 +1,6 @@
{ {
"name": "website", "name": "website",
"version": "6.0", "version": "6.1",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",

View File

@ -14,7 +14,6 @@
</script> </script>
<footer style="border-top: solid 2px var(--{color()});"> <footer style="border-top: solid 2px var(--{color()});">
<div class="info">
<div class="links"> <div class="links">
<span> <span>
<Link link={import.meta.env.WEBSITE_SOURCE_URL} bold={true}>{$_("footer.source")}</Link> <Link link={import.meta.env.WEBSITE_SOURCE_URL} bold={true}>{$_("footer.source")}</Link>
@ -32,12 +31,7 @@
> >
</span> </span>
</div> </div>
<span> <span class="counter">
{$_("footer.powered")}
</span>
</div>
<div class="useless">
<span>
{$_("footer.number", { {$_("footer.number", {
values: { values: {
total: data.total, total: data.total,
@ -48,10 +42,6 @@
<span style="color: var(--{color()})">({$_("footer.wow")})</span> <span style="color: var(--{color()})">({$_("footer.wow")})</span>
{/if} {/if}
</span> </span>
<span>
{$_("footer.version", { values: { api_version: "v1", frontend_version: pkg.version } })}
</span>
</div>
</footer> </footer>
<style> <style>
@ -61,27 +51,29 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
background: var(--black-1); background: var(--black-1);
box-sizing: border-box;
padding: 20px 50px 20px 50px;
} }
div { div {
display: flex; display: flex;
color: var(--white-2);
font-size: var(--size-2); font-size: var(--size-2);
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
} }
.useless { span {
margin: 25px 50px 25px 0; color: var(--white-2);
font-size: 15px;
}
.counter {
text-align: right; text-align: right;
} }
.info { .links {
margin: 25px 0 25px 50px;
text-align: left; text-align: left;
}
.info .links {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 5px; gap: 5px;

View File

@ -8,15 +8,20 @@
<svelte:head> <svelte:head>
<title>[ngn.tf] | {title}</title> <title>[ngn.tf] | {title}</title>
<meta content="[ngn.tf] | {title}" property="og:title" /> <meta name="description" content={desc} />
<meta content={desc} property="og:description" /> <meta name="author" content="ngn" />
<meta content={app_url()} property="og:url" /> <meta name="keywords" content="ngn,ngn13,ngn1,ngn.tf" />
<meta content="#000000" data-react-helmet="true" name="theme-color" /> <meta name="color-scheme" content="only dark" />
<meta name="theme-color" content="#000000" />
<meta property="og:title" content="[ngn.tf] | {title}" />
<meta property="og:description" content={desc} />
<meta property="og:url" content={app_url()} />
<link <link
rel="alternate" rel="alternate"
type="application/atom+xml" type="application/atom+xml"
href={api_urljoin("/news/en")} href={api_urljoin("/news/en")}
title="Atom Feed" title="Service news and updates"
/> />
</svelte:head> </svelte:head>

View File

@ -1,14 +1,35 @@
<script> <script>
import { browser } from "$app/environment";
import { color } from "$lib/util.js"; import { color } from "$lib/util.js";
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
export let picture = ""; export let picture = "";
export let title = ""; export let title = "";
let title_cur = "";
function animate(title) {
if (!browser) return;
let id = window.setTimeout(function () {}, 0);
while (id--) clearTimeout(id);
title_cur = "";
for (let i = 0; i < title.length; i++) {
setTimeout(() => {
title_cur += title[i];
}, i * 70);
}
}
$: animate(title);
</script> </script>
<header> <header>
<div> <div>
<h1 class="title" style="color: var(--{color()})">{title.toLowerCase()}</h1> <h1 class="title" style="color: var(--{color()})">{title_cur}</h1>
<h1 class="cursor" style="color: var(--{color()})">_</h1> <h1 class="cursor" style="color: var(--{color()})">_</h1>
</div> </div>
<img src="/profile/{picture}.png" alt="" /> <img src="/profile/{picture}.png" alt="" />
@ -50,9 +71,6 @@
header div .title { header div .title {
text-shadow: var(--text-shadow); text-shadow: var(--text-shadow);
overflow: hidden; overflow: hidden;
width: 0;
animation: typing 1s steps(20, end) forwards;
animation-delay: 0.3s;
} }
header div .cursor { header div .cursor {

View File

@ -5,7 +5,7 @@
"donate": "donate" "donate": "donate"
}, },
"home": { "home": {
"title": "Hello world!", "title": "hello world!",
"welcome": { "welcome": {
"title": "about", "title": "about",
"desc": "Welcome to my website, I'm ngn", "desc": "Welcome to my website, I'm ngn",
@ -29,9 +29,9 @@
}, },
"services": { "services": {
"title": "services", "title": "services",
"desc": "A part from working on stupid shit, I host free (as in freedom, and price) services available for all", "desc": "A part from working on stupid shit, I host free (as in freedom and price) services available for all",
"speed": "All of these services are available over a 600 Mbit/s interface", "speed": "All of these services are available over an 1 Gbit interface",
"security": "All use SSL encrypted connection and they are all privacy-respecting", "security": "All use SSL encrypted connection and they respect your privacy and freedom",
"privacy": "Accessible from clearnet, TOR and I2P, no region or network blocks", "privacy": "Accessible from clearnet, TOR and I2P, no region or network blocks",
"bullshit": "No CDNs, no cloudflare, no CAPTCHA, no analytics, no bullshit", "bullshit": "No CDNs, no cloudflare, no CAPTCHA, no analytics, no bullshit",
"link": "See all the services!" "link": "See all the services!"
@ -42,7 +42,7 @@
} }
}, },
"services": { "services": {
"title": "Service Status", "title": "service status",
"none": "No services found", "none": "No services found",
"search": "Search for a service", "search": "Search for a service",
"feed": "News and updates", "feed": "News and updates",
@ -54,7 +54,7 @@
} }
}, },
"donate": { "donate": {
"title": "Donate Money!", "title": "donate!",
"info": "I spend a lot of time and money on different projects and maintaining different services.", "info": "I spend a lot of time and money on different projects and maintaining different services.",
"price": "I mostly pay for hosting and electricity. Which when added up costs around 550₺ per month (~$15 at the time of writing).", "price": "I mostly pay for hosting and electricity. Which when added up costs around 550₺ per month (~$15 at the time of writing).",
"details": "So even a small donation would be useful. And it would help me keep everything up and running.", "details": "So even a small donation would be useful. And it would help me keep everything up and running.",
@ -64,20 +64,15 @@
"address": "Adress/Link" "address": "Adress/Link"
} }
}, },
"doc": {
"title": "Documentation"
},
"error": { "error": {
"title": "Something went wrong!", "title": "something went wrong!",
"report": "Report this issue" "report": "Report this issue"
}, },
"footer": { "footer": {
"source": "Source", "source": "Source",
"license": "License", "license": "License",
"privacy": "Privacy", "privacy": "Privacy",
"powered": "Powered by Svelte, Go, SQLite and donations",
"number": "Visited {total} times since {since}", "number": "Visited {total} times since {since}",
"wow": "wow!!", "wow": "wow!!"
"version": "Using API version {api_version}, frontend version {frontend_version}"
} }
} }

View File

@ -5,7 +5,7 @@
"donate": "bağış" "donate": "bağış"
}, },
"home": { "home": {
"title": "Merhaba Dünya!", "title": "merhaba dünya!",
"welcome": { "welcome": {
"title": "hakkımda", "title": "hakkımda",
"desc": "Websiteme hoşgeldiniz, ben ngn", "desc": "Websiteme hoşgeldiniz, ben ngn",
@ -30,11 +30,10 @@
"services": { "services": {
"title": "servisler", "title": "servisler",
"desc": "Salak şeyler inşa etmenin yanı sıra, herkes için kullanıma açık özgür ve ücretsiz servisler host ediyorum", "desc": "Salak şeyler inşa etmenin yanı sıra, herkes için kullanıma açık özgür ve ücretsiz servisler host ediyorum",
"speed": "Tüm servisler 600 Mbit/s ağ arayüzü üzerinden erişilebilir", "speed": "Tüm servisler 1 Gbit ağ arayüzü üzerinden erişilebilir",
"security": "Hepsi SSL şifreli bağlantı kullanıyor ve hepsi gizliğinize önem veriyor", "security": "Hepsi SSL şifreli bağlantı kullanıyor ve hepsi gizliliğinize ve özgürlüğünüze saygı gösteriyor",
"privacy": "Accessible from clearnet, TOR and I2P, no region or network blocks",
"privacy": "Açık ağdan, TOR ve I2P'den erişilebilirler, bölge ya da ağ blokları yok", "privacy": "Açık ağdan, TOR ve I2P'den erişilebilirler, bölge ya da ağ blokları yok",
"bullshit": "CDN yok, cloudflare yok, CAPTCHA yok, analitikler yok, boktan saçmalıklar yok", "bullshit": "CDN yok, cloudflare yok, CAPTCHA yok, analitikler ve diğer saçmalıklar yok",
"link": "Tüm servisleri incele!" "link": "Tüm servisleri incele!"
}, },
"projects": { "projects": {
@ -43,7 +42,7 @@
} }
}, },
"services": { "services": {
"title": "Servis Durumu", "title": "servis durumu",
"none": "Servis bulunamadı", "none": "Servis bulunamadı",
"search": "Bir servisi ara", "search": "Bir servisi ara",
"feed": "Yenilikler ve güncellemeler", "feed": "Yenilikler ve güncellemeler",
@ -55,7 +54,7 @@
} }
}, },
"donate": { "donate": {
"title": "Para Bağışla!", "title": "bağış yap!",
"info": "Farklı projeler ve farklı servisleri yönetmek için oldukça zaman ve para harcıyorum.", "info": "Farklı projeler ve farklı servisleri yönetmek için oldukça zaman ve para harcıyorum.",
"price": "Çoğunlukla hosting ve elektrik için ödeme yapıyorum. Bunlar eklendiği zaman aylık 550₺ civarı bir miktar oluyor (yazdığım sırada ~15$).", "price": "Çoğunlukla hosting ve elektrik için ödeme yapıyorum. Bunlar eklendiği zaman aylık 550₺ civarı bir miktar oluyor (yazdığım sırada ~15$).",
"details": "Bu sebepten küçük bir bağış bile oldukça faydalı olacaktır. Ve herşeyi açık ve çalışmakta tutmama yardımcı olacaktır.", "details": "Bu sebepten küçük bir bağış bile oldukça faydalı olacaktır. Ve herşeyi açık ve çalışmakta tutmama yardımcı olacaktır.",
@ -65,20 +64,15 @@
"address": "Adres/Bağlantı" "address": "Adres/Bağlantı"
} }
}, },
"doc": {
"title": "Dökümantasyon"
},
"error": { "error": {
"title": "Birşeyler yanlış gitti!", "title": "birşeyler yanlış gitti!",
"report": "Bu sorunu raporlayın" "report": "Bu sorunu raporlayın"
}, },
"footer": { "footer": {
"source": "Kaynak", "source": "Kaynak",
"license": "Lisans", "license": "Lisans",
"privacy": "Gizlilik", "privacy": "Gizlilik",
"powered": "Svelte, Go, SQLite ve bağışlar tarafından destekleniyor",
"number": "{since} tarihinden beri {total} kez ziyaret edildi", "number": "{since} tarihinden beri {total} kez ziyaret edildi",
"wow": "vay be!!", "wow": "vay be!!"
"version": "Kullan API versiyonu {api_version}, arayüz versiyonu {frontend_version}"
} }
} }

View File

@ -1,14 +1,22 @@
<script> <script>
import { api_version } from "$lib/api.js";
import Header from "$lib/header.svelte"; import Header from "$lib/header.svelte";
import Error from "$lib/error.svelte"; import Error from "$lib/error.svelte";
import Head from "$lib/head.svelte"; import Head from "$lib/head.svelte";
import Card from "$lib/card.svelte"; import Card from "$lib/card.svelte";
import Link from "$lib/link.svelte"; import Link from "$lib/link.svelte";
import { browser } from "$app/environment";
import { _, locale } from "svelte-i18n"; import { _, locale } from "svelte-i18n";
import { color } from "$lib/util.js"; import { color } from "$lib/util.js";
let { data } = $props(); let { data } = $props();
if (browser) {
window._version = {};
window._version.app = pkg.version;
window._version.api = api_version;
}
</script> </script>
<Head title="home" desc="home page of my personal website" /> <Head title="home" desc="home page of my personal website" />

View File

@ -1,9 +1,8 @@
import { doc_get_list, doc_get } from "$lib/doc"; import { doc_get } from "$lib/doc";
export async function load({ fetch, params }) { export async function load({ fetch, params }) {
try { try {
return { return {
docs: await doc_get_list(fetch),
doc: await doc_get(fetch, params.name), doc: await doc_get(fetch, params.name),
error: "", error: "",
}; };

View File

@ -22,7 +22,7 @@
</script> </script>
<Head title="documentation" desc="website and API documentation" /> <Head title="documentation" desc="website and API documentation" />
<Header picture="reader" title={$_("doc.title")} /> <Header picture="reader" title={data.doc[$locale].title} />
{#if data.error.length !== 0} {#if data.error.length !== 0}
{#if !data.error.includes("not found")} {#if !data.error.includes("not found")}
@ -30,26 +30,9 @@
{/if} {/if}
{:else} {:else}
<main> <main>
{#if data.doc !== undefined}
<div class="markdown-body" style="--link-color: var(--{color()})"> <div class="markdown-body" style="--link-color: var(--{color()})">
{@html marked.parse(data.doc[$locale].content)} {@html marked.parse(data.doc[$locale].content)}
</div> </div>
<div class="docs">
{#each data.docs[$locale] as doc}
{#if doc.title == data.doc[$locale].title}
<a href="/doc/{doc.name}" style="border-color: var(--{color()})">
<h1>{doc.title}</h1>
<h3>{doc.desc}</h3>
</a>
{:else}
<a href="/doc/{doc.name}" style="border-color: var(--white-3)">
<h1>{doc.title}</h1>
<h3>{doc.desc}</h3>
</a>
{/if}
{/each}
</div>
{/if}
</main> </main>
{/if} {/if}
@ -58,66 +41,10 @@
main { main {
padding: 50px; padding: 50px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: start;
gap: 30px; gap: 30px;
} }
main .docs {
display: flex;
flex-direction: column;
align-items: end;
gap: 6px;
}
main .docs a {
display: flex;
flex-direction: column;
background: var(--black-3);
text-decoration: none;
box-sizing: border-box;
border-right-style: solid;
padding: 15px;
width: 100%;
gap: 4px;
}
main .docs a:hover {
box-shadow: var(--box-shadow-2);
}
main .docs a h1 {
font-size: var(--size-3);
color: var(--white-1);
font-weight: 900;
}
main .docs a h3 {
font-size: var(--size-2);
color: var(--white-3);
font-weight: 100;
text-decoration: none;
}
main .markdown-body :global(a) { main .markdown-body :global(a) {
color: var(--link-color); color: var(--link-color);
} }
@media only screen and (max-width: 900px) {
main {
flex-direction: column-reverse;
}
main .docs {
width: 100%;
}
main .docs a {
border-right-style: none;
border-left-style: solid;
width: 100%;
}
}
</style> </style>

View File

@ -9,13 +9,3 @@
border-color: transparent; border-color: transparent;
} }
} }
@keyframes typing {
from {
width: 0%;
}
to {
width: 100%;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

2
app/static/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-Agent: *
Disallow: /doc/

View File

@ -1,4 +1,4 @@
{ {
"title": "API documentation", "title": "API",
"desc": "Website's API documentation" "desc": "Website's API documentation"
} }

View File

@ -1,6 +1,7 @@
My website's API stores information about my self-hosted services, it also allows me to My website's API, [api.ngn.tf](https://api.ngn.tf), stores information about my
publish news and updates about these services using an Atom feed and it keeps track of self-hosted services, it also allows me to publish news and updates about these
visitor metrics. The API itself is written in Go and uses SQLite for storage. services using an Atom feed and it keeps track of visitor metrics. The API itself is
written in Go and uses SQLite for storage.
This documentation contains information about all the available API endpoints. This documentation contains information about all the available API endpoints.

View File

@ -1,4 +1,4 @@
{ {
"title": "API dökümantasyonu", "title": "API",
"desc": "Websitesinin API dökümantasyonu" "desc": "Websitesinin API dökümantasyonu"
} }

View File

@ -1,6 +1,7 @@
Websitemin API self-host edilen servisler hakkında bilgileri tutuyor, bu servisler hakkında Websitemin API, [api.ngn.tf](https://api.ngn.tf), self-host edilen servisler hakkında bilgileri
haberleri ve güncellemeleri bir Atom feed'i aracılığı ile paylaşmama izin veriyor ve ziyartçi tutuyor, bu servisler hakkında haberleri ve güncellemeleri bir Atom feed'i aracılığı ile
metriklerini takip ediyor. API'ın kendisi Go ile yazıldı ve veritabanı olarak SQLite kullanıyor. paylaşmama izin veriyor ve ziyartçi metriklerini takip ediyor. API'ın kendisi Go ile yazıldı ve
veritabanı olarak SQLite kullanıyor.
Bu dökümentasyon tüm erişeme açık API endpoint'leri hakkında bilgiler içeriyor. Bu dökümentasyon tüm erişeme açık API endpoint'leri hakkında bilgiler içeriyor.

View File

@ -1,4 +1,4 @@
{ {
"title": "License", "title": "source license",
"desc": "Source code license" "desc": "Source code license"
} }

View File

@ -1,4 +1,4 @@
{ {
"title": "Lisans", "title": "kaynak lisansı",
"desc": "Kaynak kodu lisansı" "desc": "Kaynak kodu lisansı"
} }

View File

@ -1,4 +1,4 @@
{ {
"title": "Privacy", "title": "privacy",
"desc": "Learn how I respect your privacy" "desc": "Learn how I respect your privacy"
} }

View File

@ -1,4 +1,4 @@
{ {
"title": "Gizlilik", "title": "gizlilik",
"desc": "Gizliliğinize nasıl önem verdiğimi öğrenin" "desc": "Gizliliğinize nasıl önem verdiğimi öğrenin"
} }

View File

@ -10,6 +10,7 @@
#include "util.h" #include "util.h"
option_t options[] = { option_t options[] = {
// name value requied
{"host", "0.0.0.0:7003", true }, // host the server should listen on {"host", "0.0.0.0:7003", true }, // host the server should listen on
{"docs_dir", "./docs", true }, // documentation directory {"docs_dir", "./docs", true }, // documentation directory
{"", NULL, false}, {"", NULL, false},

View File

@ -13,7 +13,11 @@ int main() {
if (!config_load(&conf)) if (!config_load(&conf))
return EXIT_FAILURE; return EXIT_FAILURE;
host = config_get(&conf, "host");
if (NULL == (host = config_get(&conf, "host"))) {
ctorm_fail("failed to get the host configuration");
return EXIT_FAILURE;
}
ctorm_config_new(&app_config); ctorm_config_new(&app_config);
app_config.disable_logging = true; app_config.disable_logging = true;
@ -22,7 +26,6 @@ int main() {
// middlewares // middlewares
MIDDLEWARE_ALL(app, "/*", route_cors); MIDDLEWARE_ALL(app, "/*", route_cors);
MIDDLEWARE_ALL(app, "/*/*", route_cors); MIDDLEWARE_ALL(app, "/*/*", route_cors);
MIDDLEWARE_ALL(app, "/*/*/*", route_cors);
// routes // routes
GET(app, "/list", route_list); GET(app, "/list", route_list);