mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Add support for multithreaded API servers
This commit is contained in:
parent
e502a2d8c8
commit
6c3fcf699e
6 changed files with 66 additions and 1 deletions
|
|
@ -1,17 +1,23 @@
|
|||
import { randomBytes } from "node:crypto";
|
||||
import { consoleLogger } from "@loggers";
|
||||
import { asc, inArray, like } from "drizzle-orm";
|
||||
import type { Status } from "~database/entities/Status";
|
||||
import { db } from "~drizzle/db";
|
||||
import { setupDatabase } from "~drizzle/db";
|
||||
import { Notes, Tokens, Users } from "~drizzle/schema";
|
||||
import { app } from "~index";
|
||||
import { Note } from "~packages/database-interface/note";
|
||||
import { User } from "~packages/database-interface/user";
|
||||
|
||||
await setupDatabase(consoleLogger);
|
||||
|
||||
/**
|
||||
* This allows us to send a test request to the server even when it isnt running
|
||||
* @param req Request to send
|
||||
* @returns Response from the server
|
||||
*/
|
||||
export async function sendTestRequest(req: Request) {
|
||||
// return fetch(req);
|
||||
return app.fetch(req);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue