actually start implementing the backend slowly
This commit is contained in:
parent
37ae49b66e
commit
342fd30d62
19 changed files with 977 additions and 136 deletions
17
src/routes/api/status/[userId]/+server.ts
Normal file
17
src/routes/api/status/[userId]/+server.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { json } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from './$types';
|
||||
import { Status } from '$lib';
|
||||
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
const { userId } = params;
|
||||
|
||||
const status = Object.values(Status)[Math.floor(Math.random() * Object.values(Status).length)];
|
||||
|
||||
return json({
|
||||
userId,
|
||||
status,
|
||||
lastActive: Date.now() - Math.floor(Math.random() * 600000),
|
||||
customStatus: Math.random() > 0.5 ? 'vibing 🟢' : null,
|
||||
});
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue