Test Grunt served pages in Virtualbox - node.js

I'm developing some HTML-files using a lot of different libraries, but everything is compiled and served using grunt ('grunt serve'), which fires up my default browser and connects on 127.0.0.1:9000. I can copy/paste that URL into other browsers on my OS (Mac OS X) with no issues.
However, I also need to test in IE, where I normally use VirtualBox with browsers from modern.ie, but the URL is not available on those images (which makes perfect sense as it's a local IP). How do I make those URL's available to my VirtualBox images?
If I use my MAMP setup, I can access the URL's I've configured in my hosts file, but as I'm not using MAMP for this, that won't be an option.
Thanx in advance for any help!
/kim

Managed to get it to work, and as hgoebl said, it was a purely networking issue. Basically, I just followed this: http://naxoc.net/2013/10/22/windows-in-virtualbox-on-the-mac/ and everything works now.

Related

List all webbrowsers installed on OSX, linux or Windows with nodejs

I would like to get the list of all webbrowsers installed using nodejs.
If possible on different OS like Windows,OSX and Linux.
For example, if Chrome is installed, I want to run it otherwise run Firefox or IE or Safari depending on the OS.
I can't find any module or internal function to get the webbrowsers.
Thanks in advance for your help.
This isn't possible because you are then saying you would be controlling a user's computer and what software it runs. If you are able to do that, then anyone could.
This assumes you are talking about general usage and not those in a closed and controlled environment, such as a group of users inside a company.
browser-launcher enable you to Detect, launch and stop browsers cross platform

SAML not working across computers

I have a SAML web application. I have put its war in a tomcat, and can run it. It works perfectly locally, the endpoint is set to localhost. However, when I copy the entire tomcat directory to another machine, it does not work.
Essentially, I am asking what could vary between 2 machines that would affect tomcat.
I worked it out - I needed to install the Java Cryptography Extension on my computer. (Best solution is to install it into ALL of your JDKs/JREs and that way it will definitely work).

Running vline-node example on IIS

I have successfully tested the vline-node example locally, but would like to push it out to a server. I have tried to install the example as an application on an IIS8 website, placing the example code under wwwroot. I have done tried this both within the root and inside a virtual directory, pointing to the views folder. I am able to login to the application from a browser on the server, although, since javascript is turned off on the server browsers for security, so functionality is missing.
However, when I try to access the site from a remote browser I am not able to login. Actually, I can see that there is something wrong with my paths, as the include files are not found.
The more I've thought about this the more confused I've become. I'd like to run this under IIS, but wonder if that makes sense. Can someone offer a clean solution for hosting the vline-node example on a Windows Server, ideally under IIS?
Since you are using the node example, you'll need to make sure that node is actually running on your IIS server. Here's a SO response that may be helpful: How to run Node.JS server for a web application?
Note that in our node example the "main" file is vline-node.js, so use that in place of the app.js that is mentioned.

How to replace IIS with Node.js for simple websites

I am coming from Microsoft world so please bear with me on this. I was told I could install node.js and use that as a web server instead of IIS. This is a very small business application. In IIS I can create virtual directory and point to the location of the web page and everything works just fine. Based on very little I read, I have few questions;
Is it possible to run node js as a windows service or any other form so that it runs for ever? I did find the forever package that I think I can use.
In IIS, I can create virtual directory set the port and thats it, I have myself a website.
I do not see any examples where I can use a directory where I have a web page, written in java script and point it to run as a web site. All the examples have some thing like server.js and that runs and routes the call. what is the other way to host web sites and use node.js to simple run as a fast web server.
I was told I could install node.js and use that as a web server instead of IIS.
This is true, but as you already found out then you are in charge of providing for things that IIS was already doing for you (e.g. automatically restart on reboot, or on crashes, hosting multiple sites by creating virtual folders, et cetera.)
You can indeed get all of these things worked out in Node.js and there are several libraries that help on each of these areas. It's not too hard but you'll need to do a bit of researching.
You can also run Node.js behind IIS. Take a look at iisnode http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Is it possible to run node js as a windows service or any other form so
that it runs for ever?
The library Forever takes care of restarting the site when it crashes...but I don't know if you can run it as a Windows Service. I haven't tried that.
In IIS, I can create virtual directory set the port and thats it,
I have myself a website.
I assume you are talking about a site that serves static HTML files, right? If that's the case that's very easy to support in Node.js either writing your own web server or using Express.js to serve static files.
I do not see any examples where I can use a directory where I have a web page,
written in java script and point it to run as a web site. All the examples
have some thing like server.js and that runs and routes the call.
Here is an extremely simple example to serve plain HTML files in Node.js https://gist.github.com/2573391 Don't use this in production, though. It's just an example and it does not have any kind of error handling or security.
what is the other way to host web sites and use node.js to simple run
as a fast web server.
As others have said, you should look into Express.js http://expressjs.com/ It provides some of the infrastructure that you are very likely going to need when building traditional web sites.
You say you're running a "very small business application" behind IIS. Unless it's written for Node.js (in JavaScript), it won't work.
There are no examples pointing to a directory and running that as a website, because that's not how things are done in Node.js. You write a Node.js-application and pull in a webserver-library.
Put simply, In Node.js, you don't embed the appliation in the webserver; you embed the webserver in the application.
When I used node.js, I redirected HTTP requests by a proxy server, nginx. I don’t know if you can directly bind node.js as an HTTP server, but for what’s it worth, nginx is pretty nice!
First things first, allow me to share an introduction. IMHO you should take this decision ( of moving from IIS to nodeJS) by adding various parameters. I belong to the Java & PHP community yet I use NodeJS to achieve extremely specific implementation where NodeJS perform the fastest ( fast IO, AJAX-JSON responses & more ). As you are coming with a Microsoft background you should bare with less comfortable solutions.
Yes, its possible to run NodeJs as a windows service and Forever will do fine.
and yes you can create "Virtual Directories" but by creating symbolic links to each of your customer's web site.
I recommend to take a good look at bouncy & express, If you're willing to take this step then these packages is just what you need.
Cheers!

D3(SVG) browser support

According to caniuse
http://caniuse.com/#search=svg
there is full support for SVG except for IE 7,8, but when I view in Chrome and Firefox, many examples don't work
For example both azimuthal and albers in the examples found here
https://github.com/mbostock/d3/tree/master/examples
Both work fine in Safari
My browser versions
Chrome
Version 21.0.1180.82
Firefox
14.0.1
Anyone care to comment as to why these examples aren't working?
As #Josh commented, the most likely reason is that you are viewing these examples out of your local file system, rather than using a local web server as described on the Wiki.
When running the examples locally, note that your browser may enforce strict permissions for reading files out of the local file system. Some examples use AJAX which works differently via HTTP instead of local files. To view the examples locally, you must have a local web server. Any web server will work; for example you can run Python's built-in server:
python -m SimpleHTTPServer 8888 &
Once this is running, go to http://localhost:8888/examples/.

Resources