yagu0 / vchess

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

Routing not working when running server with npm start #14

Closed smartchessguiapp closed 4 years ago

smartchessguiapp commented 4 years ago

If I run the server using npm start in the server directory, then I get 404 Not Found error when trying to open / or /#/.

The server is up, because for path /variants I get {"errmsg":"Unauthorized access"}, which is ok, because I'm not allowed to get JSON paths.

If I enable JSON paths in server/utils/access.js, then I get proper JSON with variant info ( proving that the databse is populated ), like:

{"variantArray":[{"id":1,"name":"Alice","description":"Both sides of the mirror"},{"id":2,"name":"Allmate1","description":"Mate any piece (v1)"},{"id":3,"name":"Allmate2","description":"Mate any piece (v2)"},{"id":4,"name":"Antiking1","description":"Keep antiking in check (v1)"},
...

However when running the server with npm run serve in the client directory, the site loads, but path /variants returns HTML ( see also https://github.com/yagu0/vchess/issues/12 ).

yagu0 commented 4 years ago

If I run the server using npm start in the server directory, then I get 404 Not Found error when trying to open / or /#/.

Yes it's normal, because the server doesn't define any main index "/" path.

The server is up, because for path /variants I get {"errmsg":"Unauthorized access"}, which is ok, because I'm not allowed to get JSON paths.

If I enable JSON paths in server/utils/access.js, then I get proper JSON with variant info ( proving that the databse is populated ), like:

{"variantArray":[{"id":1,"name":"Alice","description":"Both sides of the mirror"},{"id":2,"name":"Allmate1","description":"Mate any piece (v1)"},{"id":3,"name":"Allmate2","description":"Mate any piece (v2)"},{"id":4,"name":"Antiking1","description":"Keep antiking in check (v1)"},
...

However when running the server with npm run serve in the client directory, the site loads, but path /variants returns HTML ( see also #12 ).

See my answer on #12 : you probably have wrong parameters.

smartchessguiapp commented 4 years ago

In view of https://github.com/yagu0/vchess/issues/14#issuecomment-601449096 and https://github.com/yagu0/vchess/issues/12#issuecomment-601447794 I close this.