Skip to content

Commit

Permalink
fix: allow setting config from scratch (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxakuru authored Dec 13, 2024
1 parent fa15ccb commit 6eaa9de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export default {
ctx.config = config;

console.debug('resolved config: ', JSON.stringify(config));
if (!config) {
// if config not defined and the request is not to set the config, 404
if (!config && (request.method !== 'POST' || ctx.url.pathname.split('/')[3] !== 'config')) {
return errorResponse(404, 'config not found');
}

Expand Down

0 comments on commit 6eaa9de

Please sign in to comment.