qb1t
qb1t
Explore posts from servers
NNuxt
Created by qb1t on 11/17/2024 in #❓・help
NuxtUI v2 make primary color black
Hi I am using nuxt ui v2 in my project and I want my app to be light theme with black elements on it, but I am not able to change my primary color to just black (or any other color) I don't know what to do, it looks like if the ui library was just completely ignoring my app config. My debug app config that doesn't work: app.config.ts
export default defineAppConfig({
ui: {
primary: 'blue',
gray: 'cool'
},
});
export default defineAppConfig({
ui: {
primary: 'blue',
gray: 'cool'
},
});
Even with this the primary color is still green
6 replies
PPrisma
Created by qb1t on 9/30/2024 in #help-and-questions
Correct way to setup prisma + docker
(I am new to prisma this is my first project using it) Hi I am currently trying to dockerise one of my typescript apps (discord bot) which is using prisma with sqlite database. I am in the middle of writing the dockerfile This is it so far:
FROM node:18-alpine

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the TypeScript code
RUN npm run build

# Prisma needs to generate the client
RUN npx prisma generate

# Run the bot using the built JavaScript file
CMD ["npm", "run", "start"]
FROM node:18-alpine

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the TypeScript code
RUN npm run build

# Prisma needs to generate the client
RUN npx prisma generate

# Run the bot using the built JavaScript file
CMD ["npm", "run", "start"]
My question is what is the proper way to set up migrations or something so that when I push a new version of the scheme.prisma the database automatically gets updated without wiping current data. The sqlite database is persistent across the container builds.
7 replies
NNuxt
Created by qb1t on 2/4/2023 in #❓・help
Scroll to top when new page loads
How do I make nuxt scroll to top every time new page is visited? Right now I tried to make my own plugin but it doesn't work for some reason... (It doesn't even console log) scroll.js
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:finished', () => {
console.log("Scrolling to top");
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
})
});
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:finished', () => {
console.log("Scrolling to top");
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
})
});
44 replies
NNuxt
Created by qb1t on 1/20/2023 in #❓・help
Help with CORS
Hi so I need my website to load resources from an external api on client side Things I tried: using the built-in $fetch() method but I'm getting cors errors using the @nuxtjs/axios module but that doesn't even allow nuxt to start using normal axios and configuring it like this
import axios from 'axios'

const axiosInstance = axios.create({
baseURL: 'http://localhost:3001',
withCredentials: true,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Accept, Content-Type, Authorization'
}
});

export default axiosInstance;
import axios from 'axios'

const axiosInstance = axios.create({
baseURL: 'http://localhost:3001',
withCredentials: true,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Accept, Content-Type, Authorization'
}
});

export default axiosInstance;
I'm out of ideas what can I do?
3 replies