add cors + adjusting dockerfile

This commit is contained in:
Emily
2024-09-28 13:37:10 +02:00
parent 0ba44a406d
commit 33b730e66b
10 changed files with 135 additions and 50 deletions

View File

@@ -1,9 +1,12 @@
import { checkApiKey, checkAuthorization, eventsListApi } from '~/server/services/ApiService';
import { useCors } from '~/server/utils/useCors';
export default defineEventHandler(async event => {
useCors(event);
const { rows, from, to, limit } = await readBody(event);
const token = checkAuthorization(event);

View File

@@ -1,9 +1,12 @@
import { checkApiKey, checkAuthorization, eventsListApi, } from '~/server/services/ApiService';
import { useCors } from '~/server/utils/useCors';
export default defineEventHandler(async event => {
useCors(event);
const { row, from, to, limit } = getQuery(event);
const token = checkAuthorization(event);

View File

@@ -1,10 +1,13 @@
import { checkApiKey, checkAuthorization } from '~/server/services/ApiService';
import { visitsListApi } from '../../services/ApiService';
import { useCors } from '~/server/utils/useCors';
export default defineEventHandler(async event => {
useCors(event);
const { rows, from, to, limit } = await readBody(event);
const token = checkAuthorization(event);

View File

@@ -2,9 +2,12 @@
import { ApiSettingsModel } from '@schema/ApiSettingsSchema';
import { VisitModel } from '@schema/metrics/VisitSchema';
import { checkApiKey, checkAuthorization, visitsListApi } from '~/server/services/ApiService';
import { useCors } from '~/server/utils/useCors';
export default defineEventHandler(async event => {
useCors(event);
const { row, from, to, limit } = getQuery(event);
const token = checkAuthorization(event);