diff --git a/packages/sharelist/CHANGELOG.md b/packages/sharelist/CHANGELOG.md index 1ef48e82..9e54ea59 100644 --- a/packages/sharelist/CHANGELOG.md +++ b/packages/sharelist/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.3.9](https://github.com/reruin/sharelist/compare/v0.3.8...v0.3.9) (2021-10-23) + + + ## [0.3.8](https://github.com/reruin/sharelist/compare/v0.3.7...v0.3.8) (2021-10-19) diff --git a/packages/sharelist/app.js b/packages/sharelist/app.js index 99188639..c7c34208 100755 --- a/packages/sharelist/app.js +++ b/packages/sharelist/app.js @@ -52,7 +52,7 @@ if (!fs.existsSync('./cache')) { fs.mkdirSync('./cache') } -const port = app?.sharelist?.config?.port || 33001 +const port = process.env.PORT || 33001 const server = http.createServer(app.callback()) server.on('error', onError).on('listening', onListening) diff --git a/packages/sharelist/app/controller/api.js b/packages/sharelist/app/controller/api.js index 969fb7be..8bef6fc1 100644 --- a/packages/sharelist/app/controller/api.js +++ b/packages/sharelist/app/controller/api.js @@ -121,7 +121,6 @@ module.exports = { let sharelist = this.app.sharelist let runtime = await createRuntime(ctx) let { data, error } = await sharelist.getFiles(runtime) - if (error) { ctx.body = { error } } else { @@ -130,9 +129,9 @@ module.exports = { .sort((a, b) => (a.type == 'folder' ? -1 : 1)) .forEach((i) => { if (i.type == 'file') { - i.download_url = ctx.origin + '/api/drive/get?download=true&id=' + encodeURIComponent(i.id) + i.download_url = '/api/drive/get?download=true&id=' + encodeURIComponent(i.id) if (i.extra?.preview_url) { - i.preview_url = ctx.origin + '/api/drive/get?download=true&preview=true&id=' + encodeURIComponent(i.id) + i.preview_url = '/api/drive/get?download=true&preview=true&id=' + encodeURIComponent(i.id) } } }) diff --git a/packages/sharelist/app/index.js b/packages/sharelist/app/index.js index 207db0f8..cfa49ca7 100644 --- a/packages/sharelist/app/index.js +++ b/packages/sharelist/app/index.js @@ -1,5 +1,3 @@ const { App } = require('./core/app') -module.exports = new App() - -console.log(Buffer.from('rQWtTu7NDn+6sifyQLEfYw==', 'base64').toString('hex')) \ No newline at end of file +module.exports = new App() \ No newline at end of file diff --git a/packages/sharelist/package.json b/packages/sharelist/package.json index 1d114589..d0092995 100644 --- a/packages/sharelist/package.json +++ b/packages/sharelist/package.json @@ -1,6 +1,6 @@ { "name": "sharelist", - "version": "0.3.8", + "version": "0.3.9", "bin": "app.js", "repository": "https://github.com/reruin/sharelist", "license": "MIT",