SpringChallenge2023
SpringChallenge2023 copied to clipboard
Running test gives empty page
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
I've got the same problem. @dremovd did you found a solution?
Try copying the files in src\main\resources\view\assets to src\main\resources\view\assets\assets then recompile
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:
- install node.js
-
cd src\main\resources\view
- remove file package-lock.json (it contains URL internal to CodinGame company so it will break node.js)
- call
npm install
- call
npx tsc --build
- 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>
- in folder containing pom.xml, call
maven clean install
(the jar will now contain the transpiled typescript) - run the main and enjoy