Test a webservice on a different port locally without JSONP

I'm currently writing a webservice (with node.js) for an AngularJS frontend which is hosted with node.js

It will later be available through a proxy under domain.com/api and therefore I don't need JSONP.

For local testing purposes i have my AngularJS app running on localhost:80 and my node.js backend on localhost:3000. Naturally I'm not able to query json requests. The easies

What would be the best setup to test my homepage locally without screwing to much in my setup?

I'm currently working on windows. Linux is also an option if it is easier.

Would it be possible to write a simple proxy for express that hosts both apps in the same domain?

You can use the hosts file to set the domain.com/api to localhost. This is done in /etc/hosts in Linux, but its present somewhere in Windows too. Another thing that helps me a lot is ssh tunneling. You can, for example, tunnel remote ports (where your backend is running) to localhost with ssh -L localPort:your.server:remotePort

It's not exactly what you asked for, but the easiest might be to have the node.js app serve the AngularJS app, too. It's quite efficient, certainly efficient enough to use for development.

If it's an expressjs app, you can just add

app.use(express['static'](__dirname + "/public"));

before your other routes to have it look for static files in ./public/

If your app is served by a template or build system that you can't easily reproduce in node.js, then another option would be to run nginx, apache or haproxy on some port (80 or 5000 or ...) and have that proxy to the current backend server for the app and port 3000 (the node.js app) for the API/data requests.

You might even be able to have your server currently running on port 80 do this.

As a final idea you could also setup the node.js app to proxy to port 80 for the "app files".

Edit - I just realized that both of your apps are written in node.js. Would it be possible to set it up so you run them separately in production but together in development? Put all the real functionality in modules and then have three separate "loaders" that start the apps, one together and then a loader for each individually.