enzostvs HF staff commited on
Commit
b7c592d
·
1 Parent(s): d1ef1b5

edit sh build file

Browse files
entrypoint.sh CHANGED
@@ -1,6 +1,8 @@
1
  #!/bin/bash
2
  npx prisma generate &&
3
  npm run build &&
 
 
4
  npx prisma generate &&
5
  npx prisma migrate deploy &&
6
  npx prisma db push &&
 
1
  #!/bin/bash
2
  npx prisma generate &&
3
  npm run build &&
4
+ # mkdir -p ./static/data && ln -s /data/uploads ./static/data/uploads
5
+ ln -s /data/uploads ./build/client/uploads &&
6
  npx prisma generate &&
7
  npx prisma migrate deploy &&
8
  npx prisma db push &&
src/hooks.server.ts DELETED
@@ -1,19 +0,0 @@
1
- /** @type {import('@sveltejs/kit').Handle} */
2
- import { symlink } from 'fs';
3
- import { resolve as pathResolve } from 'path';
4
- import { env } from '$env/dynamic/public';
5
-
6
- export async function handle({ event, resolve }) {
7
- // create symlink to static folder
8
-
9
- const staticPath = pathResolve(env.PUBLIC_FILE_UPLOAD_DIR as string);
10
- const staticTarget = pathResolve('./build/static');
11
- symlink(staticPath, staticTarget, (err) => {
12
- if (err) {
13
- console.error(err);
14
- }
15
- });
16
-
17
- const response = await resolve(event);
18
- return response;
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/routes/api/community/+server.ts CHANGED
@@ -1,8 +1,8 @@
 
 
1
  import { json, type RequestEvent } from '@sveltejs/kit';
2
  import prisma from '$lib/prisma';
3
 
4
- /** @type {import('./$types').RequestHandler} */
5
-
6
  export async function GET(request : RequestEvent) {
7
  const page = parseInt(request.url.searchParams.get('page') || '0')
8
  const filter = request.url.searchParams.get('filter') || 'new'
@@ -46,6 +46,8 @@ export async function GET(request : RequestEvent) {
46
  },
47
  })
48
 
 
 
49
  return json({
50
  cards,
51
  total_items: total_reposId
 
1
+ /** @type {import('./$types').RequestHandler} */
2
+
3
  import { json, type RequestEvent } from '@sveltejs/kit';
4
  import prisma from '$lib/prisma';
5
 
 
 
6
  export async function GET(request : RequestEvent) {
7
  const page = parseInt(request.url.searchParams.get('page') || '0')
8
  const filter = request.url.searchParams.get('filter') || 'new'
 
46
  },
47
  })
48
 
49
+
50
+
51
  return json({
52
  cards,
53
  total_items: total_reposId