yagu0 / vchess

Chess variants website: https://vchess.club
ISC License
19 stars 8 forks source link

Variants are empty in development server #12

Closed smartchessguiapp closed 4 years ago

smartchessguiapp commented 4 years ago

It is not possible to test create seek and analysis board feature in development server, because variants are empty. Their description is missing and the variant combo box for creating a variant seek is also empty.

yagu0 commented 4 years ago

Did you populate the database ? If yes variants box shouldn't be empty.

smartchessguiapp commented 4 years ago

Found some trivial errors, that made it impossible for the database to work. See pull request #13 .

After fixing these errors and checking that the database is populated, variants are still empty. From console eror log is seems that path /variants returns HTML instead of JSON, resulting in JSON parse error in store.js.

yagu0 commented 4 years ago

Hum, sounds like you may have not configured the parameters well. In local mode, mine are :

===== Client side ===== const Parameters = { socketUrl: "ws://localhost:3000", serverUrl: "http://localhost:3000", credentials: "include" };

===== Server side ===== siteURL: "http://localhost:8080", env: process.env.NODE_ENV || 'development', cors: { enable: true, allowedOrigin: "http://localhost:8080", }, [...]

If all of them are good then I don't understand :/ Because /variants is a fetch request returning JSON (if the route is found).

smartchessguiapp commented 4 years ago

Thanks for the clarification of config, that solved it. I now have variants, can issue seeks and analysis board works.

Well, for the most part, but https://github.com/yagu0/vchess/blob/1ad8802192781dde074aa4b9529bd65c405ccc6f/server/routes/news.js#L28 runs into an error, because it wants to return the timestamp of the last news, and there is no last news, as news are empty.

yagu0 commented 4 years ago

Ah ! I'll fix that "empty last news bug" right now :) Thanks.