3

I was hopeful that one of you could walk me through setting up the most minimal project possible that serves an Aurelia application with Express and Node. I am hoping to create a MEAN application where the A stands for Aurelia, but I cannot seem to get it to work. I know there is a project here: Node Aurelia GitHub that is a project which uses Node and Express to serve the Aurelia navigation sample app, but there is too much going on in it at the moment for me to understand it.

If anyone is willing to show me how to do this, I would very much appreciate it. I learn best from simple examples and haven't been able to find anything minimal that does what I want it to do. Perhaps continuing from this post would be a good approach: Setting Up Aurelia From Scratch.

You can view my current attempt at getting this running on GitHub. When this application is run, it appears that Aurelia starts, but nothing displays and I get the error:

Error: Cannot read property 'Symbol(toStringTag)' of null Evaluating http://localhost:5000/jspm_packages/npm/babel-core@5.8.35/browser.js Evaluating http://localhost:5000/jspm_packages/npm/babel-core@5.8.35.js Error loading http://localhost:5000/jspm_packages/npm/babel-core@5.8.35.js Error loading http://localhost:5000/app.js at t (http://localhost:5000/jspm_packages/system.js:4:61) at g (http://localhost:5000/jspm_packages/system.js:4:9747) at http://localhost:5000/jspm_packages/system.js:4:8054

Any help would be greatly appreciated. Thank you so much!


Edit

I believe I have found the answer to the issue I was having, but would still like people's feedback on how they would set up a minimal node, express, aurelia application. I believe the issue was that I was making an incredibly novice mistake and was not actually transpiling my JavaScript into a format the browser understands. I added the code to do this and was able to run my application without issue. Thank you to those of you who provided feedback, it is very much appreciated.

Community
  • 1
  • 1
KevinM
  • 209
  • 2
  • 13
  • Is your goal to have the client (Aurelia app) and server (REST API) deployed at a single URL? – Todd Price Mar 10 '16 at 19:30
  • Yeah, that is exactly the setup I'm going for. – KevinM Mar 10 '16 at 19:33
  • Possibly this is a duplicate of a more general question regarding Node and SPA applications. e.g. http://stackoverflow.com/questions/19040148/node-js-and-single-page-web-application could help answer your question. – Todd Price Mar 10 '16 at 19:37
  • Thank you for your link, but I think I understand how the setup for a SPA within node works. I have been able to successfully use angular as my client side framework before but seem to be having trouble specifically with Aurelia. I'll edit my comment to include the exact error I am getting. I didn't want to include it at first because I was hopeful to see how someone more knowledgeable than me would set it up, instead of just getting the answer to my specific issue. Thanks! – KevinM Mar 10 '16 at 19:44

1 Answers1

1

Clone the Aurelia skeleton navigation project. This provides a complete Aurelia sample app. It's essentially everything you need to get a base Aurelia client project up and running with little effort. Next serve the Aurelia sample app client files from your Node.js Express app

cmd
  • 11,622
  • 7
  • 51
  • 61
  • 2
    I have used the Aurelia skeleton project before; I actually intended to start with exactly the approach you've outlined, but I became overwhelmed by all of the files and tooling that I didn't understand. I was really looking for the absolute minimum needed to get an Aurelia app served by express working. However, I have since figured out that all I really need from the skeleton project is the gulp build.js file and the babel-settings. Thank you for your insight though! – KevinM Mar 11 '16 at 04:48
  • @KevinM I know this is a late response but the unfortunate reality of the situation, even today, is that there are a large number of tools and libraries one must learn to be able to function effectively in the modern web development space. It sucks. I don't think anyone disagrees. – Carson Jan 25 '17 at 21:18