Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrui06 committed Apr 9, 2024
1 parent a5be36c commit 171bead
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ logs
.env.*
!.env.example

assets/upload/*
public/upload
2 changes: 2 additions & 0 deletions docker-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdir -p ${pwd}/moments
docker run --name moments -d -v ${pwd}/moments:/app/data -v ${pwd}/moments/upload:/app/.output/public/upload -p 3000:3000 moments
2 changes: 2 additions & 0 deletions prisma/migrations/20240409065410_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- This is an empty migration.
update User set avatarUrl = 'https://avatar.iran.liara.run/public/2' where id = 1;
2 changes: 2 additions & 0 deletions prisma/migrations/20240409071118_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- This is an empty migration.
update User set avatarUrl = null where id = 1;
2 changes: 2 additions & 0 deletions prisma/migrations/20240409071334_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- This is an empty migration.
update User set avatarUrl = 'avatar.png' where id = 1;
Binary file added public/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions server/api/files/[filename].get.ts

This file was deleted.

2 changes: 1 addition & 1 deletion server/api/files/upload.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export default defineEventHandler(async (event) => {
const filename = short.generate() + "." + filetype;

const filepath = `${process.env.UPLOAD_DIR}/${filename}`;
console.log('filepath is : ',filepath)
try{
await fs.writeFile(filepath, file.data);
}catch(e){
console.log('filepath is : ',filepath)
console.log('writeFile error is : ',e)
}

Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

mkdir -p /app/data/upload
npx prisma migrate deploy
node /app/.output/server/index.mjs
node /app/.output/server/index.mjs > output.log 2>&1

0 comments on commit 171bead

Please sign in to comment.