getsandbox / worker-cli

Sandbox Worker is the core processing component of the Sandbox product
https://getsandbox.com
230 stars 62 forks source link

Compiled binary doesnt allow editing. #10

Closed calebrepkes closed 8 years ago

calebrepkes commented 8 years ago

Hey,

So I downloaded the compiled app. But I seem to be unable to edit the main.js thats in there. Am I missing something or is there no way to edit it right now?

Even though the hosted service looks really easy, at the moment Im unable to use it due to other reasons.

nhoughto commented 8 years ago

Not sure i understand, you edit your main.js using a standard text editor, when changed it should trigger a refresh of the JS and you should see your changes in the next request.

Is that what you are doing? Or are you expecting a UI like the Cloud version? If you want a UI you either need to use the Cloud or Server versions.

calebrepkes commented 8 years ago

1) I downloaded the Compiled Binary, but I don't see a main.js in that. 2) I understood the part about the UI. Thats why Im bumped I can't use the cloud service yet. 3) Then I downloaded the Zip File, there I can edit the main.js. But now Im having trouble running the build via gradle.

What I meant as problem is, I can't edit the main.js from the compiled binary. And I don't know if the compiled version will look at the Zip file (aka: sandbox-master)

nhoughto commented 8 years ago

Ok

So the binary doesn't provide a main.js, it just runs your existing Sandbox definitions. As per the instructions, you set a base directory:

--base= (Overrides working directory)

To the directory where your main.js, other JS files, templates etc are kept as per a normal Sandbox git repository. You need to create and edit your main.js, and refer to the directory with the runtime.

Sorry it is a bit confusing, we will update the instructions. Thanks

calebrepkes commented 8 years ago

No I get it now. I just didn't realise at first I needed to have both and then run sandbox from command line. :-) Just like the CLI abbreviation, I just didn't get it.

I edited the main.js already. Im just having troubles running the sandbox run from CLI. As my path settings are apparently not good. Trying to fix that now.

ps. where did you place Sandbox the binary? in Applications or somewhere else?

calebrepkes commented 8 years ago

Okay got it working.

Download binary again. Place it in same folder as source code. Added a $PATH to the same folder Now when I run CLI it works.

I did not change the directory though. And now it says it I did not specify the route.

So Im trying to add the --base=\usr\bla\bla\bla\bla\sandbox-master\examples\ But it doesn't take it: Invalid Base Path

Any last clues? :-) Thnx for your time btw.

calebrepkes commented 8 years ago

Okay. got it working.

I did not need to add the base url. I only needed to move the main.js to the main folder (so out of the example folder.)

HTTP GET /test (Matched route '/test')

Headers: {Accept=/, Accept-Encoding=gzip, deflate, Accept-Language=en-US, Cache-Control=no-cache, Connection=keep-alive, Host=localhost:8080, Postman-Token=, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Postman/4.0.0 Chrome/47.0.2526.73 Electron/0.36.2 Safari/537.36}

No body found

<< Status: 200 (took 239ms)

<< Headers: {Content-Type=text/plain}

<< Body: 'Hello world'

Cool stuff man. Thnx for your time