#/api/ missing from request URL
20 messages · Page 1 of 1 (latest)
@dapper fable
const getQueues = async () => {
const { data } = await useFetch("/resources/user/work-queue-aggregate")
queues.value = data
}
in what file u use that?
and u did define route in server/api/user/work-queue-aggregate?
yes I did, this is a transition from nuxt-bridge => nuxt 3, the server was working just fine before with axios. From my understanding the auto generated routes didn't change in nuxt 3. and yes my file path is "/api/resources/user/work-queue-aggregate.get.js"
then u need
const getQueues = async () => {
const { data } = await useFetch("/api/resources/user/work-queue-aggregate")
queues.value = data
}
coz its under api folder
I thought "/api/" was automatically registered in the request? https://nuxt.com/docs/migration/server#server
it is but
for nuxt to distinguish
real pages routes
from server routes
api is predefined for server routes
not to collide with eachother
since it shares same port
and server
Oh understandable, Thank you!