From cddbc7fa89bb07392fad3b8b9b4e60f6e927b537 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Fri, 16 Feb 2024 22:44:11 -0500 Subject: [PATCH] add docs, start planning this app a bit better. --- docs/api.yml | 23 +++++++++++++++++++++++ server/src/routes/channel.ts | 16 ++++++++++++++++ server/src/routes/user.ts | 10 ++++++++++ 3 files changed, 49 insertions(+) create mode 100644 docs/api.yml create mode 100644 server/src/routes/channel.ts diff --git a/docs/api.yml b/docs/api.yml new file mode 100644 index 0000000..dcd9612 --- /dev/null +++ b/docs/api.yml @@ -0,0 +1,23 @@ +openapi: '3.0.3' +info: + title: Slovocast API + description: The Slovocast internal API Service definition + contact: + name: Dave Smith-Hayes + email: me@davesmithhayes.com + url: https://slovocast.com + version: 1.0.0 +components: + schemas: + User: + type: object + properties: + id: + type: integer + format: uint64 + email: + type: string + format: email + password: + type: string + diff --git a/server/src/routes/channel.ts b/server/src/routes/channel.ts new file mode 100644 index 0000000..7ca20f3 --- /dev/null +++ b/server/src/routes/channel.ts @@ -0,0 +1,16 @@ +import { Hono, Context } from 'hono'; + +const channelRoutes = new Hono(); + +channelRoutes.get('/:channelSlug', async (c: Context) => { + + return c.json([ + { + channel: { + name: 'Something' + } + } + ]); +}); + +export default channelRoutes; diff --git a/server/src/routes/user.ts b/server/src/routes/user.ts index 801712f..78bad4d 100644 --- a/server/src/routes/user.ts +++ b/server/src/routes/user.ts @@ -35,4 +35,14 @@ app.post('/register', async (c: Context) => { } }); +app.post('/login', async (c: Context) => { + + return c.json({ "success": true }); +}); + +app.post('/create/channel', async (c: Context) => { + + return c.json({ "success": true }); +}); + export default app;