Is it possible to run application written an Amber without node.js? I mean is it nessesary to run file server with node ./server/sever.js ?
--
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. |
Sure, it's just js files at the end. node.js is used for convenience to serve the pages and handle Amber package commits. Nico On Apr 19, 2013, at 2:25 PM, XumuK <[hidden email]> wrote: Is it possible to run application written an Amber without node.js? I mean is it nessesary to run file server with node ./server/sever.js ? -- 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. |
It means that i need to open /path-to-project/index.html in any browser and this application will work?
I try ti do this, but it not worked... пятница, 19 апреля 2013 г., 16:26:46 UTC+4 пользователь nicolas petton написал:
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. |
Here the index.html which i try to open without node.js
What is wrong? <html lang="ru"> <head> <title>Graph visualizer</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="style.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../../js/amber.js"></script> <script src="../_lib/jquery.min.js"></script> <script src="../_lib/arbor.js"></script> <script type="text/javascript"> loadAmber({ files: ['Graphs.js'], prefix: 'projects/GraphVisualizer/js', ready: function() { $(function() { smalltalk.GraphVisualizer._new()._init(); }); } }); </script> </head> <body> <div id="toolBar"> <input id="browserButton" class="toolbutton" type="button" value="OpenBrowser" onclick="smalltalk.Browser._open()"></button> </div> ..........other html tags......... <canvas id="viewport" width="600" height="400"></canvas> </body> </html> пятница, 19 апреля 2013 г., 16:31:15 UTC+4 пользователь XumuK написал: It means that i need to open /path-to-project/index.html in any browser and this application will work? 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. |
nodejs also loads the javascript files while loading only the index.html loads only the index.html. 2013/4/19 XumuK <[hidden email]> Here the index.html which i try to open without node.js Sincerely yours, Apostolis Xekoukoulotakis 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. |
And how can i run this app without nodejs?
пятница, 19 апреля 2013 г., 16:47:56 UTC+4 пользователь Apostolis Xekoukoulotakis написал: -- 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 have to use a webserver, but it doesn't have to be node.
Python has the SimpleHTTPServer so you could run this in the same directory as your index.html file python -m SimpleHTTPServer and then go to localhost:8000 and see what you get. Or set up nginx, apache, etc.... to server the static files you need On 04/19/2013 06:02 AM, XumuK wrote: > And how can i run this app without nodejs? > > пятница, 19 апреля 2013 г., 16:47:56 UTC+4 пользователь Apostolis > Xekoukoulotakis написал: > > nodejs also loads the javascript files while loading only the > index.html loads only the index.html. > > > 2013/4/19 XumuK <[hidden email] <javascript:>> > > Here the index.html which i try to open without node.js > What is wrong? > > <html lang="ru"> > <head> > <title>Graph visualizer</title> > <meta http-equiv="Content-Type" content="text/html; "> > <link href="style.css" rel="stylesheet" type="text/css"> > <script type="text/javascript" src="../../js/amber.js"></script> > <script src="../_lib/jquery.min.js"></script> > <script src="../_lib/arbor.js"></script> > <script type="text/javascript"> > loadAmber({ > files: ['Graphs.js'], > prefix: 'projects/GraphVisualizer/js', > ready: function() { > $(function() { > smalltalk.GraphVisualizer._new()._init(); > }); > } > }); > </script> > </head> > <body> > <div id="toolBar"> > <input id="browserButton" class="toolbutton" type="button" > value="OpenBrowser" onclick="smalltalk.Browser._open()"></button> > </div> > > ..........other html tags......... > > <canvas id="viewport" width="600" height="400"></canvas> > </body> > </html> > > пятница, 19 апреля 2013 г., 16:31:15 UTC+4 пользователь XumuK > написал: > > It means that i need to open /path-to-project/index.html in > any browser and this application will work? > I try ti do this, but it not worked... > > пятница, 19 апреля 2013 г., 16:26:46 UTC+4 пользователь > nicolas petton написал: > > Sure, it's just js files at the end. node.js is used for > convenience to serve the pages and handle Amber package > commits. > > Nico > > > On Apr 19, 2013, at 2:25 PM, XumuK <[hidden email]> wrote: > >> Is it possible to run application written an Amber >> without node.js? I mean is it nessesary to run file >> server with/node ./server/sever.js /? >> >> -- >> 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 >> amber-lang+...@googlegroups.__com. >> For more options, visit >> https://groups.google.com/__groups/opt_out >> <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] <javascript:>. > For more options, visit https://groups.google.com/groups/opt_out > <https://groups.google.com/groups/opt_out>. > > > > > > > -- > > > Sincerely yours, > > Apostolis Xekoukoulotakis > > -- > 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. |
In reply to this post by xekoukou
Hi Apostolis,
Node.js is used as a simple webserver and not for loading the JS files. As described in the 'Writing my first app' page in the wiki you first need to load the file js/amber.js into your index.html via a <script> tag.
This provides the loadAmber() function which then is responsible for loading the JS files. Best, Manfred On Fri, Apr 19, 2013 at 2:47 PM, Apostolis Xekoukoulotakis <[hidden email]> wrote:
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. |
In reply to this post by XumuK
Hi Xumuk,
-- the problem is on the following line in amber.js: If you comment out the follwoing three lines you should be able to load index.html directly from the filesystem:
What happens is that jquery gets loaded in the browser and is therefore used for loading the JS files via XHR. Since index.html is not served via http it is also not possible to use XHR to load JS files.
Best, Manfred On Fri, Apr 19, 2013 at 3:02 PM, XumuK <[hidden email]> wrote: And how can i run this app without nodejs? 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. |
Nodejs gets the request from loadAmber(), and sends the js files. But a browser can also load files directly from the filesystem, is that what you are saying? 2013/4/20 Manfred Kröhnert <[hidden email]>
Sincerely yours, Apostolis Xekoukoulotakis 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. |
Apostolis Xekoukoulotakis wrote: > Nodejs gets the request from loadAmber(), and sends the js files. Not necessarily nodejs. Any server. apache. nginx. python -m SimpleHTTPServer. Name your own. > But a browser can also load files directly from the filesystem, is that > what you are saying? > > > 2013/4/20 Manfred Kröhnert <[hidden email] > <mailto:[hidden email]>> > > Hi Xumuk, > > the problem is on the following line in amber.js: > > https://github.com/amber-smalltalk/amber/blob/master/js/amber.js#L224 > > If you comment out the follwoing three lines you should be able to > load index.html directly from the filesystem: > > if (typeof jQuery != 'undefined') { > > > loadJS = loadJSViaJQuery; > > > } > > > What happens is that jquery gets loaded in the browser and is > therefore used for loading the JS files via XHR. > Since index.html is not served via http it is also not possible to > use XHR to load JS files. > > Best, > Manfred -- 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. |
yup. 2013/4/20 Herby Vojčík <[hidden email]>
Sincerely yours, Apostolis Xekoukoulotakis 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. |
Free forum by Nabble | Edit this page |