RyanKeeter
RyanKeeter

Reputation: 6139

How to Serve an Aurelia.io app without using Gulp watch

How do you run an Aurelia app without running gulp watch and just going to localhost:9000. Ideally I would like to just run my nodejs server and it all just works without having to run a separate task (a gulp task).

I would like to build Aurelia and just start using it in the same way that I can with Durandal.

Upvotes: 8

Views: 2956

Answers (2)

zewa666
zewa666

Reputation: 2603

take a look at the Aurelia-Node Repo for a quick start. It uses ExpressJS to provide a simple REST api as well as static serve the Aurelia App.

You'd still need the Gulp task (inside public/app) to build your es6 modules etc. but the hosting then works from node itself, so gulp build should be enough.

EDIT: The repo provides a gulpfile in the root as well. The big difference using this one is that it not only transpiles the frontend code but also browserSyncs the node application via nodemon. Again all of this is not necessary for final hosting. A normal node app.js would be enough. Gulp etc. is just used during the development process.

Upvotes: 6

virender
virender

Reputation: 4647

I download Aurelia repository from

https://github.com/aurelia/

And run project successfully via webstrom on different port not on localhost:9000 without "gulp watch" .

But I installed Aurelia dependency then started project on webstorm its run successfully.

Steps for run project without "gulp watch"...

Run given command on command line from project folder.

Install the Apps dependencies - **npm install**
Install JSPM dependencies -  **jspm install -y**
Install Gulp - **npm install gulp**

then explore your index.html page on chrome. Make sure you running Aurelia in Chrome, IE and Firefox.

I tested Aurelia application in Chrome, IE , Safari and Firefox result

Chrome - Pass IE - Pass Firefox - Pass Safari - Fail

But in safari that was fail.

Upvotes: 0

Related Questions