Arlen22 / TiddlyServer

v2 - A static file server that can also save files and mount TiddlyWiki folders
https://arlen22.github.io/tiddlyserver/
MIT License
257 stars 36 forks source link

Can't get Tiddlyserver to start using Dory on Android #123

Open TechLifeWeb opened 2 years ago

TechLifeWeb commented 2 years ago

I've been using tiddlyserver on Windows for quite awhile. Recently I picked up an Android phone and was trying to get it to work using Dory. I have my settings.json file in the same folder as my index.js folder but I get the error message below when I try to run it. Any ideas?

`/storage/emulated/0/twserv_dory/node_modules/tiddlyserver/index.js:17 var n=function(e,t){return(n=Object.setPrototypeOf||{proto:[]}instanceof Array&&function(e,t){e.proto=t}||function(e,t){for(var A in t)t.hasOwnProperty(A)&&(e[A]=t[A])})(e,t)};function i(e,t){function A(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(A.prototype=t.prototype,new A)}var r=function(){return(r=Object.assign||function(e){for(var t,A=1,n=arguments.length;A<n;A++)for(var i in t=arguments[A])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var A={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(A[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(A[n[i]]=e[n[i]])}return A}function s(e,t,A,n){var i,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,A):

SyntaxError: Unexpected token function at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:383:7) at startup (bootstrap_node.js:149:9)`

Arlen22 commented 2 years ago

Please can you check which version of Node you are running by putting the line console.log(process.version); in a file and running it. TiddlyServer requires a minimum of Node v10.

TechLifeWeb commented 2 years ago

Thanks. Looks like that is the issue. I ran node -v in the terminal of Dory and it reports 6.11.4. Not sure if it can be updated.

EDIT: Got it to work! I figured out how to update Node on Dory. For future people, there are instructions here if you read the description: https://play.google.com/store/apps/details?id=io.tempage.dorynode&hl=en&gl=US

Arlen22 commented 2 years ago

Nice. I would recommend checking out termux as well. It is a terminal app. I know for sure I have ran node scripts on it, not sure about the webserver part though. I know there's something funny about Android.

The documentation should help you. Android does not work with binding directly to 0.0.0.0, so you need to bind to the individual IP addresses. I added a feature to TiddlyServer to work with this. I'm pretty sure I had this working in Termux, but I'm very certain I had it working at one point at least in Dory. Can't remember now as I don't use android for that anymore.

"bindInfo": {
  "filterBindAddress": true,
  "bindAddress": ["192.168.0.0/16"]
}

https://arlen22.github.io/tiddlyserver/docs/serverconfig.html#bindaddress-string