amber on cloud9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

amber on cloud9

Jacob Wagner
  I have used amber on cloud9 before (https://c9.io/).  However due to changes in the code, it doesn't seem to work anymore. 

  The only thing I need to be able to do is to specify a port and ip through javascript in nodejs, which are:

"process.env.PORT" and "process.env.IP" instead of 4000 and 127.0.0.1 

  Before the changes, I used to edit server.js and just replace 4000 with "process.env.PORT", but this does not seem to be working anymore.  

  Do I need to use amberc or something?  Ideally there's a way to do this without a script change,  but I'm not sure if I can get the port necessary outside of javascript.

-Jacob

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<zenchess@gmail.com>
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert
Hi Jacob,

the Server and REPL have been merged into the AmberCli package which can be found in the cli directory.
The ./bin/server script uses this package to retain old behavior but will be removed in the future.

You should be able to edit the file cli/js/amber-cli.js and replace the return values of defaultPort and defaultHost to get the desired behavior.

AmberC is the comandline compiler for Amber and is not related to the server executable.

Best,
Manfred



On Fri, Jun 14, 2013 at 2:29 PM, Zenchess <[hidden email]> wrote:
  I have used amber on cloud9 before (https://c9.io/).  However due to changes in the code, it doesn't seem to work anymore. 

  The only thing I need to be able to do is to specify a port and ip through javascript in nodejs, which are:

"process.env.PORT" and "process.env.IP" instead of 4000 and 127.0.0.1 

  Before the changes, I used to edit server.js and just replace 4000 with "process.env.PORT", but this does not seem to be working anymore.  

  Do I need to use amberc or something?  Ideally there's a way to do this without a script change,  but I'm not sure if I can get the port necessary outside of javascript.

-Jacob

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Max-2
In reply to this post by Jacob Wagner
Hi Jacob,

use:

$ node_modules/amber/bin/server --host $IP --port $PORT
and then access the server with the "http://projectname.username.c9.io" URL scheme

max

On Friday, June 14, 2013 2:29:32 PM UTC+2, Zenchess wrote:
  I have used amber on cloud9 before (https://c9.io/).  However due to changes in the code, it doesn't seem to work anymore. 

  The only thing I need to be able to do is to specify a port and ip through javascript in nodejs, which are:

"process.env.PORT" and "process.env.IP" instead of 4000 and 127.0.0.1 

  Before the changes, I used to edit server.js and just replace 4000 with "process.env.PORT", but this does not seem to be working anymore.  

  Do I need to use amberc or something?  Ideally there's a way to do this without a script change,  but I'm not sure if I can get the port necessary outside of javascript.

-Jacob

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Herby Vojčík
Not .../bin/server --options (deprecated), but .../bin/amber serve --options (supported).

Herby

Max wrote:

> Hi Jacob,
>
> use:
>
> $ node_modules/amber/bin/server --host $IP --port $PORT
> and then access the server with the
> "http://projectname.username.c9.io" URL scheme
>
> max
>
> On Friday, June 14, 2013 2:29:32 PM UTC+2, Zenchess wrote:
>
>     I have used amber on cloud9 before (https://c9.io/). However due
>     to changes in the code, it doesn't seem to work anymore.
>
>     The only thing I need to be able to do is to specify a port and ip
>     through javascript in nodejs, which are:
>
>     "process.env.PORT" and "process.env.IP" instead of 4000 and 127.0.0.1
>
>     Before the changes, I used to edit server.js and just replace 4000
>     with "process.env.PORT", but this does not seem to be working
>     anymore.
>
>     Do I need to use amberc or something? Ideally there's a way to do
>     this without a script change, but I'm not sure if I can get the
>  
   port necessary outside of javascript.

>
>     -Jacob
>
> --
> You received this message because you are subscribed to the Google
> Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert

No, this has not been changed yet.
The Amber binary still loads the repl.

However, this will change soon.

Am 11.07.2013 14:06 schrieb "Herby Vojčík" <[hidden email]>:
Not .../bin/server --options (deprecated), but .../bin/amber serve --options (supported).

Herby

Max wrote:
Hi Jacob,

use:

$ node_modules/amber/bin/server --host $IP --port $PORT
and then access the server with the "http://projectname.username.c9.io" URL scheme

max

On Friday, June 14, 2013 2:29:32 PM UTC+2, Zenchess wrote:

    I have used amber on cloud9 before (https://c9.io/). However due
    to changes in the code, it doesn't seem to work anymore.

    The only thing I need to be able to do is to specify a port and ip
    through javascript in nodejs, which are:

    "process.env.PORT" and "process.env.IP" instead of 4000 and 127.0.0.1

    Before the changes, I used to edit server.js and just replace 4000
    with "process.env.PORT", but this does not seem to be working
    anymore.

    Do I need to use amberc or something? Ideally there's a way to do
    this without a script change, but I'm not sure if I can get the
 
  port necessary outside of javascript.

    -Jacob

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Herby Vojčík
Mea culpa.

Pity the change did not slip into 0.11.0.

Manfred Kröhnert wrote:

> No, this has not been changed yet.
> The Amber binary still loads the repl.
>
> However, this will change soon.
>
> Am 11.07.2013 14:06 schrieb "Herby Vojčík" <[hidden email]
> <mailto:[hidden email]>>:
>
>     Not .../bin/server --options (deprecated), but .../bin/amber serve
>     --options (supported).
>
>     Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Nicolas Petton
since we're trying to release more often, hopefully we won't have to wait too long :)

nico


On Jul 11, 2013, at 3:52 PM, Herby Vojčík <[hidden email]> wrote:

> Mea culpa.
>
> Pity the change did not slip into 0.11.0.
>
> Manfred Kröhnert wrote:
>> No, this has not been changed yet.
>> The Amber binary still loads the repl.
>>
>> However, this will change soon.
>>
>> Am 11.07.2013 14:06 schrieb "Herby Vojčík" <[hidden email]
>> <mailto:[hidden email]>>:
>>
>>    Not .../bin/server --options (deprecated), but .../bin/amber serve
>>    --options (supported).
>>
>>    Herby
>
> --
> You received this message because you are subscribed to the Google Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Nicolas Petton
http://www.nicolas-petton.fr

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Geert Claes
Administrator
In reply to this post by Jacob Wagner
How does one use Amber on Cloud9?  Is there a get Amber started on Cloud9 somewhere?
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Geert Claes
Administrator
This post was updated on .
In reply to this post by Max-2
I just thought I'd test the latest Amber 0.12.1 on Cloud9 and I wonder if anyone could point to what I am doing wrong.

After:
$ npm install amber
npm WARN package.json chat-example@0.0.0 No repository field.
npm http GET https://registry.npmjs.org/amber
npm http 200 https://registry.npmjs.org/amber
npm http GET https://registry.npmjs.org/amber/-/amber-0.12.1.tgz
npm http 200 https://registry.npmjs.org/amber/-/amber-0.12.1.tgz
amber@0.12.1 node_modules/amber

I did:
$ node_modules/amber/bin/amber serve --host $IP --port $PORT
Warning: project directory does not contain index.html
Warning: project directory is missing an "st" directory
Warning: project directory is missing a "js" directory
Starting file server on http://127.6.138.1:8080
./index.html does not exist

When I then open a browser tab for my: http://projectname.username.c9.io

I get:
500 Internal server error
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert
Hi Geert,

this looks like an error on NPM side.
I remember seeing something like this a few weeks ago on the Amber Travis.
Unfortunately I can't find the link right now.

The warning about 'st' and 'js' directories is not necessarily an issue if you don't want to commit code back to the server.

To get more information you could try to check the JavaScript console when loading the index.html file.

Best,
Manfred




On Thu, Nov 21, 2013 at 12:25 PM, Geert Claes <[hidden email]> wrote:
I just thought I'd test the latest Amber 0.12.1 on Cloud9 and I wonder if anyone could point to what I am doing wrong. After: $ npm install amber npm WARN package.json chat-example@0.0.0 No repository field. npm http GET https://registry.npmjs.org/amber npm http 200 https://registry.npmjs.org/amber npm http GET https://registry.npmjs.org/amber/-/amber-0.12.1.tgz npm http 200 https://registry.npmjs.org/amber/-/amber-0.12.1.tgz amber@0.12.1 node_modules/amber I did: $ node_modules/amber/bin/amber serve --host $IP --port $PORT Warning: project directory does not contain index.html Warning: project directory is missing an "st" directory Warning: project directory is missing a "js" directory Starting file server on http://127.6.138.1:8080 ./index.html does not exist When I then open a browser tab for my: http://projectname.username.c9.io I get: 500 Internal server error

View this message in context: Re: amber on cloud9

Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Geert Claes
Administrator
I am not too fussed about the warnings because I think had those with previous versions of Amber too.

With a previous version of Amber I was at least able to get to the Amber IDE via http://projectname.username.c9.io instead of the "500 Internal server error" I get now.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Herby Vojčík
IIRC one of the reasons why amber server gives 500 is when you load root of the site and index.html is missing (I wonder why it is not 404 or 403 at least).

Your example look like that.

Herby

Geert Claes wrote:

> I am not too fussed about the warnings because I think had those with
> previous versions of Amber too.
>
> With a previous version of Amber I was at least able to get to the Amber IDE
> via http://projectname.username.c9.io instead of the "500 Internal server
> error" I get now.
>
>
>
> --
> View this message in context: http://forum.world.st/amber-on-cloud9-tp4693320p4724228.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert
In reply to this post by Geert Claes
Hi Geert,

I just tried creating an Amber application on Cloud9 myself and didn't face any issues.

Here are the steps I performed:

1. create a new Node.js workspace
2. remove all template files
3. 'npm install -g bower'
4. 'bower init' (this can probably be left out)
5. 'bower install amber --save'
6. create index.html with contents taken from https://github.com/amber-smalltalk/amber/blob/master/index.html
7. prepend paths for amber.js and require.js with 'bower_components/amber/'
8. './bower_components/amber/bin/amber serve --host $IP --port $PORT'
9. point browser to http://<your workspacename>.<your username>.c9.io

Afterwards, the browser loaded the Amber IDE.

As indicated by Herby you are missing an index.html file in the directory from where you execute ./bin/amber serve.
This is also printed in the console warning.
However, return 500 is probably not the best thing to do :-)
I'll take a look and add a better error handling.

Note that you can use --base-path to specify where your index.html is located or --fallback-page which tells the server which page to use if it can't find a specific resource.

Best,
Manfred

PS: it is really hard to separate the console output from what you actually wrote. It would be great if you could separate this a bit better the next time you have such an error.





On Thu, Nov 21, 2013 at 12:25 PM, Geert Claes <[hidden email]> wrote:
I just thought I'd test the latest Amber 0.12.1 on Cloud9 and I wonder if anyone could point to what I am doing wrong. After: $ npm install amber npm WARN package.json chat-example@0.0.0 No repository field. npm http GET https://registry.npmjs.org/amber npm http 200 https://registry.npmjs.org/amber npm http GET https://registry.npmjs.org/amber/-/amber-0.12.1.tgz npm http 200 https://registry.npmjs.org/amber/-/amber-0.12.1.tgz amber@0.12.1 node_modules/amber I did: $ node_modules/amber/bin/amber serve --host $IP --port $PORT Warning: project directory does not contain index.html Warning: project directory is missing an "st" directory Warning: project directory is missing a "js" directory Starting file server on http://127.6.138.1:8080 ./index.html does not exist When I then open a browser tab for my: http://projectname.username.c9.io I get: 500 Internal server error

View this message in context: Re: amber on cloud9

Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Herby Vojčík


Manfred Kröhnert wrote:

> Hi Geert,
>
> I just tried creating an Amber application on Cloud9 myself and didn't
> face any issues.
>
> Here are the steps I performed:
>
> 1. create a new Node.js workspace
> 2. remove all template files
> 3. 'npm install -g bower'
> 4. 'bower init' (this can probably be left out)
> 5. 'bower install amber --save'
> 6. create index.html with contents taken from
> https://github.com/amber-smalltalk/amber/blob/master/index.html

... or locally from bower_components/amber/index.html, isn't it?

> 7. prepend paths for amber.js and require.js with
> 'bower_components/amber/'
> 8. './bower_components/amber/bin/amber serve --host $IP --port $PORT'
> 9. point browser to http://<your workspacename>.<your username>.c9.io
> <http://c9.io>
>
> Afterwards, the browser loaded the Amber IDE.
>
> Best,
> Manfred

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert



On Sun, Nov 24, 2013 at 1:18 PM, Herby Vojčík <[hidden email]> wrote:


Manfred Kröhnert wrote:
Hi Geert,

I just tried creating an Amber application on Cloud9 myself and didn't face any issues.

Here are the steps I performed:

1. create a new Node.js workspace
2. remove all template files
3. 'npm install -g bower'
4. 'bower init' (this can probably be left out)
5. 'bower install amber --save'
6. create index.html with contents taken from https://github.com/amber-smalltalk/amber/blob/master/index.html

... or locally from bower_components/amber/index.html, isn't it?


Right, since it is the same file you can take whichever you want :-)

 
7. prepend paths for amber.js and require.js with 'bower_components/amber/'
8. './bower_components/amber/bin/amber serve --host $IP --port $PORT'
9. point browser to http://<your workspacename>.<your username>.c9.io <http://c9.io>


Afterwards, the browser loaded the Amber IDE.

Best,
Manfred

Herby


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: amber on cloud9

Manfred Kröhnert
For those who are interested in the topic, I added the changes to the following pull request:


It replaces the 500 error with a 404 answer and the response now contains a (hopefully) better description.

Best,
Manfred




On Sun, Nov 24, 2013 at 1:43 PM, Manfred Kröhnert <[hidden email]> wrote:



On Sun, Nov 24, 2013 at 1:18 PM, Herby Vojčík <[hidden email]> wrote:


Manfred Kröhnert wrote:
Hi Geert,

I just tried creating an Amber application on Cloud9 myself and didn't face any issues.

Here are the steps I performed:

1. create a new Node.js workspace
2. remove all template files
3. 'npm install -g bower'
4. 'bower init' (this can probably be left out)
5. 'bower install amber --save'
6. create index.html with contents taken from https://github.com/amber-smalltalk/amber/blob/master/index.html

... or locally from bower_components/amber/index.html, isn't it?


Right, since it is the same file you can take whichever you want :-)

 
7. prepend paths for amber.js and require.js with 'bower_components/amber/'
8. './bower_components/amber/bin/amber serve --host $IP --port $PORT'
9. point browser to http://<your workspacename>.<your username>.c9.io <http://c9.io>


Afterwards, the browser loaded the Amber IDE.

Best,
Manfred

Herby


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.