mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Initial commit
This commit is contained in:
commit
436a79d99f
50 changed files with 870 additions and 0 deletions
16
utils/config.ts
Normal file
16
utils/config.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import data from "../config/config.toml";
|
||||
|
||||
export type ConfigType = {
|
||||
database: {
|
||||
host: string;
|
||||
port: number;
|
||||
username: string;
|
||||
password: string;
|
||||
database: string;
|
||||
}
|
||||
[ key: string ]: any;
|
||||
}
|
||||
|
||||
export const getConfig = () => {
|
||||
return data as ConfigType;
|
||||
}
|
||||
8
utils/response.ts
Normal file
8
utils/response.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export const jsonResponse = (data: object, status: number = 200) => {
|
||||
return new Response(JSON.stringify(data), {
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
status,
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue