Abou
Explore posts from serverscookies not send to external api
when i do this :
app.use((req, res, next) => {
console.log('Cookies: ', req.cookies);
next();
})
i've the cookie, but not inside my req.cookies
and btw, my cookie is set correctly with what u said
@kapa.ai
idk why i still don't have my cookies inside req.cookies
25 replies
cookies not send to external api
i already configure my cors @kapa.ai :
import express, {Express} from 'express';
import {configDotenv} from "dotenv";
import cors from 'cors';
import cookieParser from 'cookie-parser';
import mongoose from "mongoose";
import emailRoutes from "./routes/emailRoutes";
import authRoutes from "./routes/authRoutes";
const app: Express = express();
configDotenv();
app.use(cookieParser());
app.use(express.json());
app.use(cors({
origin: 'http://localhost:3000',
credentials: true,
}))
/app.use((req, res, next) => {
console.log('Cookies: ', req.cookies);
next();
})/
mongoose.connect(process.env.MONGO_URI '', {}).then(() => {
console.log('Connected to the database');
app.listen(PORT, () => {
console.log(
\x1b[32mServer is running on port ${PORT}\x1b[0m
);
});
}).catch((error) => {
console.error('Error connecting to the database', error);
})
const PORT = process.env.PORT 3000;
app.use('/auth', authRoutes);
app.use('/email', emailRoutes);25 replies
How to change .icon of my website ?
@kapa.ai i add this
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: false }, // activer pour le mode dev (voir le temps de load du ssr etc, voir opti)
css: ['~/assets/scss/main.scss'],
modules: ['@nuxt/fonts', '@nuxt/image', '@nuxtjs/device'],
fonts: {
families: [
{
name: 'Poppins',
provider: 'google',
weights: ['400', '600', '700'],
styles: ['normal'],
subsets: ['latin']
}
]
},
runtimeConfig: {
public: {
apiBaseUrl: process.env.PUBLIC_API_BASE_URL || 'http://localhost:8000'
}
},
vite: {
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
}
}
}
},
app: {
head: {
link: [
{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon.ico'
}
]
}
}
})
inside my nuxt.config but still dosen't have my good favicon...
17 replies
How to use svg
@kapa.ai when i'm using svgo, i got this error inside my terminal :
[Vue warn]: Component <Anonymous> is missing template or render function.
at <Anonymous>
at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > >
at <Anonymous key="/" vnode= { v_isVNode: true,
v_skip: true,
type:
{ name: 'index',
setup: [Function (anonymous)],
ssrRender: [Function: _sfc_ssrRender],
scopeId: 'data-v-02281a80',
__file: '/Users/ilies/IdeaProjects/whispr/pages/index.vue' },
props:
{ onVnodeUnmounted: [Function: onVnodeUnmounted],
ref:
RefImpl {
you'll find my code in a .txt
and this is my nuxt.config.ts :
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: false }, // activer pour le mode dev (voir le temps de load du ssr etc, voir opti)
css: ['~/assets/scss/main.scss'],
modules: ['@nuxt/fonts', '@nuxt/image', '@nuxtjs/device', 'nuxt-svgo'],
// add Poppins font
fonts: {
families: [
{
name: 'Poppins',
provider: 'google',
weights: ['400', '600', '700'],
styles: ['normal'],
subsets: ['latin']
}
]
},
runtimeConfig: {
public: {
apiBaseUrl: process.env.PUBLIC_API_BASE_URL || 'http://localhost:8000'
}
},
vite: {
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
}
}
}
},
svgo: {
autoImportPath: '~/assets/svg',
}
})
22 replies