@webqit/webflo 0.11.25 → 0.11.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -30,8 +30,8 @@ export default class RuntimeClient {
|
|
|
30
30
|
// --------
|
|
31
31
|
// ROUTE FOR DATA
|
|
32
32
|
// --------
|
|
33
|
-
let httpMethodName = httpEvent.request.method.
|
|
34
|
-
return router.route([httpMethodName
|
|
33
|
+
let httpMethodName = httpEvent.request.method.toUpperCase();
|
|
34
|
+
return router.route([httpMethodName, 'default'], httpEvent, {}, async event => {
|
|
35
35
|
return remoteFetch(event.request);
|
|
36
36
|
}, remoteFetch);
|
|
37
37
|
};
|
|
@@ -273,8 +273,8 @@ function declareRoutesObj(gen, routesDir, targetDir, varName, routing) {
|
|
|
273
273
|
let indexCount = 0;
|
|
274
274
|
if (Fs.existsSync(_routesDir)) {
|
|
275
275
|
walk(_routesDir, (file, namespace, relativePath) => {
|
|
276
|
-
|
|
277
|
-
if (
|
|
276
|
+
relativePath = relativePath.replace(/\\/g, '/');
|
|
277
|
+
if (relativePath.endsWith('/index.js')) {
|
|
278
278
|
// Import code
|
|
279
279
|
let routeName = 'index' + (++ indexCount);
|
|
280
280
|
// IMPORTANT: we;re taking a step back here so that the parent-child relationship for
|
|
@@ -430,6 +430,7 @@ function handleEmbeds(targetDocumentFile, embedList, unembedList) {
|
|
|
430
430
|
successLevel = 1;
|
|
431
431
|
let dom = new Jsdom.JSDOM(targetDocument), by = 'webflo', touched;
|
|
432
432
|
let embed = (src, before) => {
|
|
433
|
+
src = src.replace(/\\/g, '/');
|
|
433
434
|
let embedded = dom.window.document.querySelector(`script[src="${src}"]`);
|
|
434
435
|
if (!embedded) {
|
|
435
436
|
embedded = dom.window.document.createElement('script');
|
|
@@ -447,6 +448,7 @@ function handleEmbeds(targetDocumentFile, embedList, unembedList) {
|
|
|
447
448
|
};
|
|
448
449
|
let unembed = src => {
|
|
449
450
|
src = Path.join('/', src);
|
|
451
|
+
src = src.replace(/\\/g, '/');
|
|
450
452
|
let embedded = dom.window.document.querySelector(`script[src="${src}"][by="${by}"]`);
|
|
451
453
|
if (embedded) {
|
|
452
454
|
embedded.remove();
|
|
@@ -30,8 +30,8 @@ export default class WorkerClient {
|
|
|
30
30
|
// --------
|
|
31
31
|
// ROUTE FOR DATA
|
|
32
32
|
// --------
|
|
33
|
-
let httpMethodName = httpEvent.request.method.
|
|
34
|
-
let response = await router.route([httpMethodName
|
|
33
|
+
let httpMethodName = httpEvent.request.method.toUpperCase();
|
|
34
|
+
let response = await router.route([httpMethodName, 'default'], httpEvent, {}, async event => {
|
|
35
35
|
return remoteFetch(event.request);
|
|
36
36
|
}, remoteFetch);
|
|
37
37
|
if (!(response instanceof httpEvent.Response)) {
|
|
@@ -34,14 +34,14 @@ export default class RuntimeClient {
|
|
|
34
34
|
// --------
|
|
35
35
|
// ROUTE FOR DATA
|
|
36
36
|
// --------
|
|
37
|
-
let httpMethodName = httpEvent.request.method.
|
|
38
|
-
let response = await router.route([httpMethodName
|
|
37
|
+
let httpMethodName = httpEvent.request.method.toUpperCase();
|
|
38
|
+
let response = await router.route([httpMethodName, 'default'], httpEvent, {}, async event => {
|
|
39
39
|
return router.file(event);
|
|
40
40
|
}, remoteFetch);
|
|
41
41
|
if (!(response instanceof httpEvent.Response)) {
|
|
42
42
|
response = new httpEvent.Response(response);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
// --------
|
|
46
46
|
// Rendering
|
|
47
47
|
// --------
|