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

Parse-server is unable to connect on any port rather than 1337 #4980

Closed
suryamuppalla opened this issue Aug 17, 2018 · 6 comments
Closed

Parse-server is unable to connect on any port rather than 1337 #4980

suryamuppalla opened this issue Aug 17, 2018 · 6 comments

Comments

@suryamuppalla
Copy link

Hi,

If we run our node server on port 8080, then the parse-server is unable to connect to this port.
It is still expecting the port 1337 and localhost.

serverURL: process.env.SERVER_URL || 'http://localhost:8080/parse', // Don't forget to change to https if needed

// Serve the Parse API on the /parse URL prefix
const mountPath = process.env.SERVER_URL || process.env.PARSE_MOUNT || 'http://localhost:8080/parse';
app.use(mountPath, api);

When I access any API endpoint, it is showing as like below.

{
"code": "ECONNREFUSED",
"errno": "ECONNREFUSED",
"syscall": "connect",
"address": "127.0.0.1",
"port": 1337
}

and also in console it is showing like,

WARNING, Unable to connect to 'http://localhost:8080/parse'. Cloud code and push notifications may be unavailable!

Please help me out! Thank you!

@flovilmart
Copy link
Contributor

you have to change the listening port.

Please read the documentations and examples

https://github.com/parse-community/parse-server-example/blob/master/index.js

@suryamuppalla
Copy link
Author

Since we are unable to run our application on the server using port number 1337.
We are using 8080 port in our application.

Can't we use any other port instead of 1337 in parse-server?

@flovilmart
Copy link
Contributor

flovilmart commented Aug 17, 2018

Again please read the documentations AND examples AND guides!

you have to change the listening port.

https://docs.parseplatform.org/parse-server/guide/#usage

From what I can tell you haven't even looked at the link on the example that I gave you that shows how to set the port for listening.

@flovilmart
Copy link
Contributor

ALSO you have a publicly published your database password!

@suryamuppalla
Copy link
Author

suryamuppalla commented Aug 17, 2018

const port = process.env.PORT || 8080;

httpServer.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});

Parse is not accepting the port 8080.

Anyway thanks for suggesting. Thank you!

@flovilmart
Copy link
Contributor

if process.env.PORT is set to 1337, then for sure it's wont be 8080... So either change the PORT env variable, OR just use 8080...

You see you have you own answer :)

Also I'm really curious where you got the code for your parse-library project. It has dependencies over 2 years old libraries that I believe should not be used, and also publicly exposes credentials like your database password. this should not be public on github

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