mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:32:39 +00:00
move server to root, path, example
This commit is contained in:
28
packages/zitadel-server/examples/app.ts
Normal file
28
packages/zitadel-server/examples/app.ts
Normal 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();
|
||||
Reference in New Issue
Block a user