Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run on server(tomcat) return white empty page. #30

Open
oldfeel opened this issue Sep 9, 2016 · 5 comments
Open

Run on server(tomcat) return white empty page. #30

oldfeel opened this issue Sep 9, 2016 · 5 comments
Labels

Comments

@oldfeel
Copy link

oldfeel commented Sep 9, 2016

No description provided.

@geowarin
Copy link
Owner

geowarin commented May 22, 2017

In development, you should go to localhost:3000 to see the frontend dev server.
It creates a proxy to localhost:8080 so you can access everything from here.

It can be a little bit confusing at first, because in production, you add the static resources in the jar and use the SinglePageAppConfig to resolve them.

At the moment, the big advantage of doing this is we do not have to write anything to disk when we run in dev.

This could be fixed if we decide to write the generated files of the frontend dev server to disk and tell the SinglePageAppConfig to use this directory in dev.

This would probably make the build process less 'magical'.

I'm keeping this open for now.

@oakstair
Copy link

I also get an empty page and I don't know what to expect! I created a pull request that upgrades this project to the latest and greatest. Please review and use and help out!

@geowarin
Copy link
Owner

Well I guess one way to solve this would be including a controller that redirects to localhost:3000 in dev...

@MikeSuiter
Copy link

This is what I did to get 8080 to serve the production build. This way works with development and also gets in Spring Boot assembled JAR.

backend/build.gradle

classes.dependsOn(':frontend:assemble')

frontend/build.gradle

task bundle(type: YarnTask) {
  args = ['build']
}

task start(type: YarnTask) {
  args = ['start']
}

task test(type: YarnTask) {
  args = ['test']
}

task copyBackend(type: Copy) {
    from 'build'
    into project(':backend').file('src/main/resources/static')
}

//check.dependsOn(test)
bundle.dependsOn(yarn_install)
assemble.dependsOn(copyBackend)
copyBackend.dependsOn(bundle)

I just got this working and don't know if it's the best solution.

@yashdjoshi79
Copy link

@MikeSuiter Correct me if I am wrong but, I think the point of having a front-end with port 3000 server was to support React-hot-reloading. If you run the gradle task in production mode, it should create a fat jar which is then accessible on localhost:8080.

@oakstair could you check the console, for some errors. If you upgraded to the latest and greatest. There were a lot of methods in webpack.config that are now deprecated. So that might break some workings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants