Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PANEL] #10

Open
grokkiafk opened this issue Feb 18, 2023 · 4 comments
Open

[PANEL] #10

grokkiafk opened this issue Feb 18, 2023 · 4 comments

Comments

@grokkiafk
Copy link

Unable to connect to the server!

squad@Landau:~/sqcp/backend$ yarn start
yarn run v1.22.19
$ node App.js
[Express][1] Registered routes from: v1/Api_Auth.js
[Express][1] Registered routes from: v1/Api_Rcon.js
[Express][1] Registered routes from: v1/Api_Server.js
[Express][1] Registered routes from: v1/Api_Stats.js
[Express][1] Registered routes from: v1/Api_User.js
[Express][1] Listening on port: 3000
[DataBase][1] Data Base Connection Successfully Established

Everything has been established adequately. Without errors, it simply does not let you into the admin panel.
Screenshot_1

@milutinke
Copy link
Owner

milutinke commented Feb 20, 2023

Can you screenshot the output of the dev console in your browser?
To open it, press F12 (or CTRL + SHIFT + I) and click on Console tab.
Most likely it's an issue with CORS policy.

@grokkiafk
Copy link
Author

Yes, of course!
sc2
sc1

@grokkiafk
Copy link
Author

http://wsquad.ru:3000/login This is the address I'm going to.
POST http://wsquad.ru/api/v1/auth/login net::ERR_CONNECTION_REFUSED
And this is the error that the console gives out. Maybe there is some problem here?: But I kind of did everything according to the instructions. I apologize if I ask stupid questions, unfortunately I do not have extensive knowledge in this area 3=

@milutinke
Copy link
Owner

milutinke commented Mar 2, 2023

http://wsquad.ru:3000/login This is the address I'm going to. POST http://wsquad.ru/api/v1/auth/login net::ERR_CONNECTION_REFUSED And this is the error that the console gives out. Maybe there is some problem here?: But I kind of did everything according to the instructions. I apologize if I ask stupid questions, unfortunately I do not have extensive knowledge in this area 3=

I suggest you make a subdomain and map it as a proxy in Nginx: https://www.youtube.com/watch?v=1GSZcatwLtc
The frontend should be hosted by the backend application, not run as vue development server (mentioning this just in case).
This is most likely an issue with CORS, I suggest also looking at setting your cors policy to your domain, by default it's unrestricted.
Change this part to set the cors rule for your domain, examples: https://www.npmjs.com/package/cors
Also, one more thing, make sure that in the front end when setting the URL, there is no trailing slash (/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants