
export default defineEventHandler(async (event) => {
    const { public: { apiBase } } = useRuntimeConfig();
     const token = getCookie(event, 'token');
     const query = getQuery(event);
    try {
        const data = await $fetch(`${apiBase}/course/${query.id}?userId=${query.userId}`, {
            headers: {
               'Accept': 'application/json',
                'Authorization': `Bearer ${token}`
            },
    
        });
        return data;
    } catch (error) {

        return error;
    }

})