dart-archive / appengine_samples

Dart App Engine samples
https://www.dartlang.org/cloud/
BSD 3-Clause "New" or "Revised" License
34 stars 11 forks source link

connecting server component to web component #14

Open XilaiZhang opened 2 years ago

XilaiZhang commented 2 years ago

Hello, I am trying to get the client server model to work. I first run dart run build runner serve web:7777 to serve the web component on http://localhost:7777. And then I run export DART_PUB_SERVE=http://localhost:7777, and finally dart bin/server.dart. However, when I visit localhost:8080, it always could not find index.html and shows 404. Am I missing any of the steps? Thanks in advance for any help!

tmst commented 2 years ago

You might try loading localhost:7777 into the browser. :-) I think there's another port for an admin interface, but it's been a few years.

XilaiZhang commented 2 years ago

Hello Tom, thanks for the reply. In my case, in browser localhost:7777 only serves the web component, the button on web page is not clickable and does not handle the server requests such as /items . Meanwhile, the correct server logic is served on localhost:8080. Is there a way I can get the server hooked up with the web component, so that the server logic triggers the correct web pages?

tmst commented 2 years ago

Sorry, Xilai. I think you mean it only serves the HTML component rather than Javascript, etc. But it's been so long I can't recall. Seems like there was configuration file I consulted for the locations of stuff.