Can I use the Angular 2 Dart frontend with Node.js backend?

I am planning on the tools that I will use in my web application. I would like to use Node.js as a server, because it has a module that would be especially useful to me. However, I would also like to use Angular 2 (Dart) with Polymer.dart in the interface. Excuse me if the answer should be obvious, but how will it work to combine these two parts of my application without problems (and without conversion tools), as is usually done in the MEAN stack, since Dart is not directly compatible with JS?

There are currently no tutorials or resources available demonstrating this combination. It seems to me that the more common case is that Dart also acts as a server.

0
source share
1 answer

How to Serve the Dart Client Application

The client and server can be two different applications that are not connected to each other at all. The only connection that is required is that the server can interpret the requests sent by the client, and that the client can interpret the responses.

The built-in Dart client application is similar to static HTML and can be served by any HTTP server. I do not know Node.js, but I assume that it has a directory where it serves static content. Here you place the build output of your Dart client application.

Connection between Dart click and Node.js server

, Dart , . REST, WebSocket, Ajax JSON . , , /, . . JS TS Dart, . , , .

, "" . Node.js, , pub serve ( JS ). ( , , Nginx Dart script shelf_proxy), Dart pub serve Rest/Ajax/WebSocket Node.js.

+1

Source: https://habr.com/ru/post/1652786/


All Articles