diff --git a/src/routes/s/[slug].ts b/src/routes/s/[slug].ts new file mode 100644 index 0000000..e64da5c --- /dev/null +++ b/src/routes/s/[slug].ts @@ -0,0 +1,10 @@ +import { pogo } from "../../../deps.ts" + +import { Pika, database } from "../../../utils/index.ts" + +export const method = ['*'] +export const handler = (req: pogo.Request) => { + // console.log(`${req.params.slug}`) + console.log(Pika.gen("shorten")) + return `${req.params.slug}` +} \ No newline at end of file diff --git a/src/routes/s/index.ts b/src/routes/s/index.ts new file mode 100644 index 0000000..6942039 --- /dev/null +++ b/src/routes/s/index.ts @@ -0,0 +1,7 @@ +export const method = ['*'] +export const handler = () => { + return { + name: "Lio", + url: "lio.cat" + } +} \ No newline at end of file diff --git a/utils/types/PageRoute.ts b/utils/types/PageRoute.ts new file mode 100644 index 0000000..b7f9474 --- /dev/null +++ b/utils/types/PageRoute.ts @@ -0,0 +1,5 @@ +export default interface PageRoute { + method: string | string[] + handler: void | any + route: string +} diff --git a/utils/types/Shorten.ts b/utils/types/Shorten.ts new file mode 100644 index 0000000..e8abac1 --- /dev/null +++ b/utils/types/Shorten.ts @@ -0,0 +1,5 @@ +export default interface Shorten { + id: string + target: string + slug: string +} \ No newline at end of file