move server to root, path, example

This commit is contained in:
Max Peintner
2023-04-20 14:26:55 +02:00
parent 26cf9132a0
commit d154f07f1c
12 changed files with 125 additions and 92 deletions

View File

@@ -0,0 +1,28 @@
import {
ZitadelServerOptions,
getServer,
getServers,
initializeServer,
} from "#/server";
import { GetMyUserResponse, getAuth } from "#/auth";
async function getMyUser(): Promise<GetMyUserResponse> {
const auth = await getAuth();
const response = await auth.getMyUser({});
return response;
}
async function main() {
const zitadelConfig: ZitadelServerOptions = {
apiUrl: "https://dev-mfhquc.zitadel.cloud/",
token: "123",
};
if (!getServers().length) {
initializeServer(zitadelConfig);
}
const app = getServer();
}
main();