mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
452 B
17 lines
452 B
export default defineEventHandler(async (event) => {
|
|
const setupDone = await Database.setup.done();
|
|
if (setupDone) {
|
|
throw createError({
|
|
statusCode: 400,
|
|
statusMessage: 'Invalid state',
|
|
});
|
|
}
|
|
|
|
const { host, port } = await readValidatedBody(
|
|
event,
|
|
validateZod(hostPortType, event)
|
|
);
|
|
await Database.system.updateClientsHostPort(host, port);
|
|
await Database.setup.set('success');
|
|
return { success: true };
|
|
});
|
|
|