Skip to content

Commit 1a807c6

Browse files
committed
fix: allow setting config from scratch
1 parent fa15ccb commit 1a807c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export default {
6868
ctx.config = config;
6969

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

0 commit comments

Comments
 (0)