DEBUG dir

This commit is contained in:
2023-02-19 04:30:18 +08:00
parent 584fb8ce1d
commit a958bab60a
2 changed files with 10 additions and 8 deletions

View File

@@ -13,13 +13,13 @@ export default defineNuxtConfig({
}
}
},
//nitro: {
// devProxy: {
// '/api': {
// target: 'http://106.15.192.42:3000/api'
// }
// },
//},
nitro: {
devProxy: {
'/api': {
target: 'http://106.15.192.42:3000/api'
}
},
},
//devServer: {
// host: '106.15.192.42',
// port: 3000,

View File

@@ -6,7 +6,9 @@ export default defineEventHandler(async event => {
// 判断当前执行目录是否存在 outputs 文件夹, 否则在上一级文件夹
let path = `outputs/txt2img-samples/samples/${event.context.params.id}`
if (!fs.existsSync('outputs')) {
path = `../outputs/txt2img-samples/samples/${event.context.params.id}`
// 打印当前执行目录
console.log('cwd:', process.cwd())
path = `../../outputs/txt2img-samples/samples/${event.context.params.id}`
}
console.log('path:', path)
return fs.readFileSync(path)