reroute lmao
This commit is contained in:
parent
dcc647d085
commit
d28eb23190
4 changed files with 21 additions and 2 deletions
10
src/hooks.ts
Normal file
10
src/hooks.ts
Normal 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`
|
||||
}
|
||||
}
|
|
@ -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)`),
|
||||
});
|
||||
|
|
0
src/routes/.well-known/atproto-did/+page.svelte
Normal file
0
src/routes/.well-known/atproto-did/+page.svelte
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p>
|
||||
This worked
|
||||
</p>
|
Loading…
Add table
Add a link
Reference in a new issue