Hi Group-

1) I have a TW that does some frontend AJAX using simple XMLHttpRequest in 
the browser. 

2) If I try to render the AJAX tiddler in Lambda, it throws the common node 
error since node requires a separate package xmlhttprequest.

3) My question is, how best to include this dependency in the Lambda. I 
tried first with npm locally, then zipping the updated package.json plus 
the node_modules folder with xmlhttprequest module included. 

3b- this still throws an error as the lambda is not finding the module. 
Presumably I am violating "everything is a tiddler" and need my js inside 
the index.js. 

3c- so it seems better approach is to require the module as a tiddler like 
var XMLHttpRequest = require("$:/mymodules/xmlhttprequest").XMLHttpRequest;


But I am new to creating modules in TW, so before I waste hours with trial 
and error I figured I'd make sure I'm on the right track. How should my 
original xmlhttprequest.js be modified so that it works as a tiddler like 
$:/mymodules/xmlhttprequest? 


Sincere thanks,

Phil 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/47575207-c2b9-4386-b8d5-aafe9ec48faa%40googlegroups.com.

Reply via email to