Skip to content

Commit

Permalink
fix: S3_ACCESS_HOST error handling in seo.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
OXeu committed Jun 7, 2024
1 parent 32eeb56 commit 5acdcf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/src/services/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ export const SEOService = (db: DB, env: Env) => {
const endpoint = env.S3_ENDPOINT;
const accessHost = env.S3_ACCESS_HOST || endpoint;
const folder = env.S3_CACHE_FOLDER || 'cache/';
if (!accessHost) {
throw new Error('S3_ACCESS_HOST is not defined');
}
return new Elysia({ aot: false })
.use(setup(db, env))
.get('/seo/*', async ({ set, params, query }) => {
if (!accessHost) {
set.status = 500;
return 'S3_ACCESS_HOST is not defined'
}
let url = params['*'];
// query concat
for (const key in query) {
Expand Down

0 comments on commit 5acdcf9

Please sign in to comment.