CodinGame / SpringChallenge2023

https://www.codingame.com/contests/spring-challenge-2023
71 stars 31 forks source link

Running test gives empty page #8

Open dremovd opened 1 year ago

dremovd commented 1 year ago

I tried to run Spring2023Main main from vs code on my Mac. It looks like working, but the page http://localhost:8888/test.html is empty (test.html is loading, but it renders to an empty page)

test.html content: https://pastebin.com/a1vcByh6

tom-willmowski commented 1 year ago

I've got the same problem. @dremovd did you found a solution?

dmortell commented 1 year ago

Try copying the files in src\main\resources\view\assets to src\main\resources\view\assets\assets then recompile

totof99 commented 11 months ago

I found the issue, it is because the view are in typescript which needs to be transpiled in javascript. Since the typescript project has a lot of dependencies, I advise you to use node.js to download them. Here the step to make it work: 1) install node.js 2) cd src\main\resources\view 3) remove file package-lock.json (it contains URL internal to CodinGame company so it will break node.js) 3) call npm install 4) call npx tsc --build 5) in order to reduce drastically the jar size and maven build time, add this to the pom.xml

<build>
   <resources>
      <resource>
         <directory>src/main/resources</directory>
         <includes>
            <include>view/assets/**</include>
            <include>view/graphics/**</include>
            <include>view/*.js</include>
         </includes>
         <filtering>false</filtering>
      </resource>
   </resources>
</build>

6) in folder containing pom.xml, call maven clean install (the jar will now contain the transpiled typescript) 7) run the main and enjoy