WIP Typing fixes for compilation
This commit is contained in:
parent
be1b9f21ec
commit
a0d5cba339
2
html.ts
2
html.ts
@ -129,7 +129,7 @@ export function profilePageHtml(profile: Profile, articles: Article[]): string {
|
|||||||
return htmlLayout(title, body, profile);
|
return htmlLayout(title, body, profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openWithNostrAppHtml(bech32Id): string {
|
function openWithNostrAppHtml(bech32Id: string): string {
|
||||||
let appLinksHtml = "";
|
let appLinksHtml = "";
|
||||||
const appLinks = [
|
const appLinks = [
|
||||||
{ title: "Habla", href: `https://habla.news/a/${bech32Id}` },
|
{ title: "Habla", href: `https://habla.news/a/${bech32Id}` },
|
||||||
|
2
ldap.ts
2
ldap.ts
@ -4,7 +4,7 @@ import config from "./config.ts";
|
|||||||
|
|
||||||
const { ldap, ldapEnabled } = config;
|
const { ldap, ldapEnabled } = config;
|
||||||
|
|
||||||
let client;
|
let client: Client;
|
||||||
if (ldapEnabled) {
|
if (ldapEnabled) {
|
||||||
client = new Client({ url: ldap.url });
|
client = new Client({ url: ldap.url });
|
||||||
}
|
}
|
||||||
|
10
server.ts
10
server.ts
@ -1,4 +1,4 @@
|
|||||||
import { Application, Router, send } from "@oak/oak";
|
import { Application, Context, Router, send } from "@oak/oak";
|
||||||
import config from "./config.ts";
|
import config from "./config.ts";
|
||||||
import naddrHandler from "./handlers/naddr.ts";
|
import naddrHandler from "./handlers/naddr.ts";
|
||||||
import nprofileHandler from "./handlers/nprofile.ts";
|
import nprofileHandler from "./handlers/nprofile.ts";
|
||||||
@ -10,7 +10,7 @@ import notFoundHandler from "./handlers/not-found.ts";
|
|||||||
|
|
||||||
const router = new Router();
|
const router = new Router();
|
||||||
|
|
||||||
router.get("/:path", async (ctx: ctx) => {
|
router.get("/:path", async (ctx: Context) => {
|
||||||
const { path } = ctx.params;
|
const { path } = ctx.params;
|
||||||
|
|
||||||
if (path.startsWith("naddr")) {
|
if (path.startsWith("naddr")) {
|
||||||
@ -26,7 +26,7 @@ router.get("/:path", async (ctx: ctx) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get("/:user/:kind.atom", async (ctx: ctx) => {
|
router.get("/:user/:kind.atom", async (ctx: Context) => {
|
||||||
const { user, kind } = ctx.params;
|
const { user, kind } = ctx.params;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -39,7 +39,7 @@ router.get("/:user/:kind.atom", async (ctx: ctx) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get("/:user/:identifier", async (ctx: ctx) => {
|
router.get("/:user/:identifier", async (ctx: Context) => {
|
||||||
const { user } = ctx.params;
|
const { user } = ctx.params;
|
||||||
|
|
||||||
if (user.startsWith("@") || user.startsWith("~")) {
|
if (user.startsWith("@") || user.startsWith("~")) {
|
||||||
@ -51,7 +51,7 @@ router.get("/:user/:identifier", async (ctx: ctx) => {
|
|||||||
|
|
||||||
router.get("/assets/:path*", async (ctx) => {
|
router.get("/assets/:path*", async (ctx) => {
|
||||||
try {
|
try {
|
||||||
const filePath = ctx.params.path;
|
const filePath = ctx.params.path || '';
|
||||||
|
|
||||||
await send(ctx, filePath, {
|
await send(ctx, filePath, {
|
||||||
root: `${Deno.cwd()}/assets`,
|
root: `${Deno.cwd()}/assets`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user