chore: update nuxt config

This commit is contained in:
riefive
2025-09-24 15:01:52 +07:00
parent 7c452c923a
commit d0b3d28cdd
6 changed files with 8 additions and 20 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
import { z } from 'zod'
const loginSchema = z.object({
name: z.string().min(6, 'Please enter a valid username'),
password: z.string().min(6, 'Password must be at least 6 characters'),
name: z.string().min(3, 'Please enter a valid username'),
password: z.string().min(3, 'Password must be at least 3 characters'),
})
const { login } = useUserStore()
+4 -7
View File
@@ -1,17 +1,14 @@
import { config as dotenvConfig } from 'dotenv'
import process from 'node:process'
dotenvConfig()
console.log(process.env.API_ORIGIN)
console.log(process.env.NUXT_PUBLIC_SIMRS_USER_API_URL)
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
runtimeConfig: {
API_ORIGIN: process.env.API_ORIGIN || 'https://main-api.dev-hopis.sabbi.id',
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'https://main-api.dev-hopis.sabbi.id',
public: {
API_ORIGIN: process.env.NUXT_API_ORIGIN || 'https://main-api.dev-hopis.sabbi.id',
}
},
ssr: false,
-1
View File
@@ -21,7 +21,6 @@
"@unovis/ts": "^1.5.1",
"@unovis/vue": "^1.5.1",
"date-fns": "^4.1.0",
"dotenv": "^17.2.2",
"embla-carousel": "^8.5.2",
"embla-carousel-vue": "^8.5.2",
"h3": "^1.15.4",
-3
View File
@@ -26,9 +26,6 @@ dependencies:
date-fns:
specifier: ^4.1.0
version: 4.1.0
dotenv:
specifier: ^17.2.2
version: 17.2.2
embla-carousel:
specifier: ^8.5.2
version: 8.6.0
+1 -4
View File
@@ -1,4 +1,3 @@
import process from 'node:process'
import { defineEventHandler, getCookie, getRequestHeaders, getRequestURL, readBody } from 'h3'
export default defineEventHandler(async (event) => {
@@ -7,7 +6,7 @@ export default defineEventHandler(async (event) => {
const url = getRequestURL(event)
const config = useRuntimeConfig()
const apiOrigin = config.API_ORIGIN
const apiOrigin = config.public.API_ORIGIN
const pathname = url.pathname.replace(/^\/api/, '')
const targetUrl = apiOrigin + pathname + (url.search || '')
@@ -36,8 +35,6 @@ export default defineEventHandler(async (event) => {
}
}
console.log(targetUrl)
const res = await fetch(targetUrl, {
method,
headers: forwardHeaders,
+1 -3
View File
@@ -1,4 +1,3 @@
import { useRuntimeConfig } from '#imports'
import { getRequestURL, readBody, setCookie } from 'h3'
export default defineEventHandler(async (event) => {
@@ -6,8 +5,7 @@ export default defineEventHandler(async (event) => {
const url = getRequestURL(event)
const config = useRuntimeConfig()
const apiOrigin = config.API_ORIGIN
const apiOrigin = config.public.API_ORIGIN
const externalUrl = apiOrigin + url.pathname.replace(/^\/api/, '') + url.search
const resp = await fetch(externalUrl, {