Merge pull request #5 from ThisIsBenny/develop

v0.1.1
This commit is contained in:
Benny 2022-02-05 08:37:18 +01:00 committed by GitHub
commit a0f294ad44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View file

@ -4,7 +4,8 @@ FROM node:lts as builder
RUN mkdir /app RUN mkdir /app
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json /app/ COPY package.json package-lock.json /app/
RUN npm ci --ignore-scripts RUN npm set-script prepare ""
RUN npm ci
ENV NODE_ENV=production ENV NODE_ENV=production
@ -25,7 +26,8 @@ RUN mkdir data
COPY package.json package-lock.json /app/ COPY package.json package-lock.json /app/
COPY ./prisma /app/prisma COPY ./prisma /app/prisma
RUN npm ci --ignore-scripts RUN npm set-script prepare ""
RUN npm ci
COPY --from=builder /app/dist /app COPY --from=builder /app/dist /app
EXPOSE 5000 EXPOSE 5000

4
package-lock.json generated
View file

@ -1,11 +1,11 @@
{ {
"name": "wishlist", "name": "wishlist",
"version": "0.1.0", "version": "0.1.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.1.0", "version": "0.1.1",
"dependencies": { "dependencies": {
"@prisma/client": "^3.8.1", "@prisma/client": "^3.8.1",
"axios": "^0.25.0", "axios": "^0.25.0",

View file

@ -1,5 +1,5 @@
{ {
"version": "0.1.0", "version": "0.1.1",
"scripts": { "scripts": {
"dev": "concurrently --kill-others \"npm run dev:frontend\" \"npm run dev:backend\"", "dev": "concurrently --kill-others \"npm run dev:frontend\" \"npm run dev:backend\"",
"dev:frontend": "vite", "dev:frontend": "vite",

View file

@ -16,7 +16,10 @@ export default async (opts: FastifyContextConfig = {}) => {
}) })
await app.register(cors, { await app.register(cors, {
origin: true, origin:
process.env.NODE_ENV === 'development'
? /https?:\/\/localhost(:\d+)?/
: false,
}) })
await app.register(compress) await app.register(compress)