Skip to content

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

Description

@suryamuppalla

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!

Activity

  1. flovilmart commented on Aug 17, 2018

    @flovilmart
    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

  2. suryamuppalla commented on Aug 17, 2018

    @suryamuppalla
    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?

  3. flovilmart commented on Aug 17, 2018

    @flovilmart
    Contributor

    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.

  4. flovilmart commented on Aug 17, 2018

    @flovilmart
    Contributor

    ALSO you have a publicly published your database password!

  5. suryamuppalla commented on Aug 17, 2018

    @suryamuppalla
    Author

    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!

  6. flovilmart commented on Aug 17, 2018

    @flovilmart
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions