Skip to content

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

Open

Description

@oldfeel
No description provided.

Activity

  1. geowarin commented on May 22, 2017

    @geowarin
    Owner

    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.

  2. oakstair commented on Sep 15, 2017

    @oakstair

    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!

  3. geowarin commented on Oct 10, 2017

    @geowarin
    Owner

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

  4. MikeSuiter commented on Oct 11, 2017

    @MikeSuiter

    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.

  5. yashdjoshi79 commented on Mar 20, 2019

    @yashdjoshi79

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions