reroute lmao

This commit is contained in:
Lara 2025-04-04 00:48:23 +03:00
parent dcc647d085
commit d28eb23190
Signed by: laratheprotogen
GPG key ID: 5C0296EB3165F98B
4 changed files with 21 additions and 2 deletions

10
src/hooks.ts Normal file
View file

@ -0,0 +1,10 @@
import type { Reroute } from '@sveltejs/kit';
export const reroute: Reroute = async ({ url }) => {
const subdomain = url.hostname.split('.')[0]
if (url.pathname === '/.well-known/atproto-did') {
return `/handles/${subdomain}/.well-known/atproto-did`
}
}

View file

@ -1,6 +1,12 @@
import { sql } from 'drizzle-orm';
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
export const user = sqliteTable('user', {
id: integer('id').primaryKey(),
age: integer('age')
id: integer('id').primaryKey({ autoIncrement: true }),
// One handle, per person
did: text('did_plc').unique().notNull(),
handle: text('handle').unique().notNull(),
createdAt: text('created_at').notNull().default(sql`(CURRENT_TIMESTAMP)`),
// Eventually I want people to be able to update their handle, but that'll probably require implementing oauth
updatedAt: text('updated_at').notNull().default(sql`(CURRENT_TIMESTAMP)`),
});

View file

@ -0,0 +1,3 @@
<p>
This worked
</p>