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

2

8

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.

Fetishist answered 17/2, 2015 at 16:30 Comment(0)
V
6

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.

Villainous answered 17/2, 2015 at 17:32 Comment(4)
I think I just read your blog post on durandal.io/blog on E2E testing. Good stuff!Fetishist
thanks ... appreciated your comparison videos for Durandal back then as well. Hope you're going to do that for Aurelia as well :)Villainous
theoretically, systemjs has a es6 transpiler built in, so you wouldn't need the gulp task at all, maybe?Hardecanute
the built in compiler is Traceuer, which tbh doesn't produce that of a nice result, but it would be possible yes. In essence you need the gulp task just for those ES6 conversions from 6to5 (now BabelJs). If you just don't like Gulp there are other alternatives like make, grunt etc. available. Take a look here babeljs.io/docs/using-babelVillainous
P
0

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.

Protect answered 18/2, 2015 at 4:52 Comment(1)
I guess in this case it just runs of from the precompiled dist folder. If you do any changes though, you'd have to manually rebuild them. Thats where the gulp task is necessary again, or another tool. Take a look at the comment above for how to use other build toolsVillainous

© 2022 - 2024 — McMap. All rights reserved.