Redstone Dart along with Angular 2 Dart

197 views
Skip to first unread message

Harikrishnadhas K

unread,
Jul 15, 2016, 7:56:51 AM7/15/16
to Dart Server-side and Cloud Development
Hi,

I'm working on a project which is using Redstone as the Server side framework which will run in Dart VM and Angular 2 for UI and Web Client. I know these two can be a different Dart projects and will run smoothly.

But I want to create a single project where Redstone will server the Angular 2 content. 

Currently I'm using a work around where i'm building the Angular 2 project and putting the generated content in the Redstone project.

Is there any straight forward method is available where the Redstone server will server the Angular 2 dart content (Angular 2 files should be convert to javascript before serving).

Thanks in Advance,
Hari

Günter Zöchbauer

unread,
Jul 18, 2016, 8:34:18 AM7/18/16
to Dart Server-side and Cloud Development
You need to redirect requests for Dart source files to `pub serve`

Joel Trottier-Hébert

unread,
Jul 18, 2016, 8:50:44 AM7/18/16
to Dart Server-side and Cloud Development
I don't see why you want to do that though. I'd choose any good web server over redstone to accomplish this. Something like Apache or Nginx, or even appengine!

That's the beauty of web app compiled as HTML/CSS/Javascript, you can have them run in any web container. That would be way cheaper than running a redstone instance on a server IMO.

Alex Haslam

unread,
Jul 18, 2016, 11:10:22 AM7/18/16
to Dart Server-side and Cloud Development
Maybe the goal here is isomorphic application? Render on the server and serve up a ready to go app instead of additional loading times

--
You received this message because you are subscribed to the Google Groups "Dart Server-side and Cloud Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud+un...@dartlang.org.
Visit this group at https://groups.google.com/a/dartlang.org/group/cloud/.

Alex Haslam

unread,
Jul 18, 2016, 12:04:32 PM7/18/16
to Dart Server-side and Cloud Development
Joel Said: "ok, but this is pretty much the point of client-side-apps: off-loading the server. I mean, sure, you can probably do this, I just don't think Angular is the good tool for that. Maybe I'm wrong though."

https://universal.angular.io/ <- Its kind of the point of Angular. Yes Off loading the server, but Isomorphic is the best of both. Render once to see up end user experience, then use as app.

Harikrishnadhas K

unread,
Jul 21, 2016, 1:55:10 AM7/21/16
to Dart Server-side and Cloud Development
Actually i want to build my entire app (both UI and server) with Dart. And it will increase the complexity of the project if i use different server for UI and database interaction or business logic which has to run in the server.

Günter Zöchbauer

unread,
Jul 21, 2016, 4:31:13 AM7/21/16
to Dart Server-side and Cloud Development
Not sure I fully understood your question. My answer above is only about development. 
In a deployment situation it doesn't matter what server you use to serve the client part, it's just static HTML, JS, CSS
The Dart server application can serve these files as well a for example Nginx while the backend is still a Dart application.

I also don't see how splitting client and server into 3 Dart projects (client, server, shared) is related to any of this.
Splitting it has the advantage thouhg, that additional dependencies for client-only and server-only don't interfere.
It caused me quite some headaches that some packages I needed only on the client were incompatible with the newest versions of packages I only need on the server and therefore couldn't update to the latest version or had to use `dependency_overrides?.

Harikrishnadhas K

unread,
Jul 25, 2016, 3:51:09 AM7/25/16
to Dart Server-side and Cloud Development
If i had to run two servers for UI and server side logic, then i have to use the CORS. That is the complexity i'm talking about.
Reply all
Reply to author
Forward
0 new messages