@based/cli
Advanced tools
Comparing version
@@ -91,3 +91,3 @@ "use strict"; | ||
const r = (0, utils_1.requireFromString)(fn.text, fn.path); | ||
const f = r.default || r; | ||
const fnDefault = r.default || r; | ||
await (0, utils_1.bundleApp)({ | ||
@@ -104,3 +104,3 @@ publicPath, | ||
const wrapper = async (based, _payload, ctx) => { | ||
let html = await f(based, params, ctx); | ||
let html = await fnDefault(based, params, ctx); | ||
const i = html.indexOf('</head>'); | ||
@@ -115,12 +115,16 @@ if (i === -1) { | ||
}; | ||
const props = { | ||
version: 1, | ||
fn: wrapper, | ||
uninstallAfterIdleTime: -1, | ||
closeAfterIdleTime: 5e3, | ||
...DEFAULTS.function, | ||
...configObj, | ||
type: 'function', | ||
}; | ||
if (r.httpResponse) { | ||
props.httpResponse = r.httpResponse; | ||
} | ||
server.functions.add({ | ||
[configObj.name]: { | ||
version: 1, | ||
fn: wrapper, | ||
uninstallAfterIdleTime: -1, | ||
closeAfterIdleTime: 5e3, | ||
...DEFAULTS.function, | ||
...configObj, | ||
type: 'function', | ||
}, | ||
[configObj.name]: props, | ||
}); | ||
@@ -127,0 +131,0 @@ clients.forEach((client) => { |
{ | ||
"name": "@based/cli", | ||
"version": "5.2.6", | ||
"version": "5.2.7", | ||
"description": "", | ||
@@ -27,3 +27,3 @@ "bin": "bin/cmd.js", | ||
"dependencies": { | ||
"@based/client": "4.7.3", | ||
"@based/client": "^4.7.3", | ||
"@based/server": "6.7.2", | ||
@@ -30,0 +30,0 @@ "@esbuild-plugins/node-globals-polyfill": "^0.2.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
193732
0.14%2812
0.14%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated