Skip to content

Instantly share code, notes, and snippets.

@jisaacstone
Last active September 1, 2017 18:24
Show Gist options
  • Save jisaacstone/01092365a32134e8aab9c27cd63da8e3 to your computer and use it in GitHub Desktop.
Save jisaacstone/01092365a32134e8aab9c27cd63da8e3 to your computer and use it in GitHub Desktop.
curl -X POST -H "Content-Type: application/json" -d '{
>   "type": "email",
>   "email": "[email protected]",
>   "password": "y4b4d4b4d00"
> }
> ' http://localhost:8080/auth
Invalid message: the "body" parameter must exist.
curl -X POST -H "Content-Type: application/json" -d '
>    {"body":[{"topic":"event","action":"emit","eventName":"coer","data":{"what?":5}}]}
>    ' http://localhost:8080/auth
{"result":"SUCCESS","body":[{"success":true}]}

config.yml:

...
connectionEndpoints:
    ...
    http:
    name: http
    options:
      # port for the http server
      port: 8080
      # host for the http server
      host: 0.0.0.0
      # allow 'authData' parameter in POST requests, if disabled only token and OPEN auth is
      # possible
      allowAuthData: true
      # enable the authentication endpoint for requesting tokens/userData.
      # note: a custom authentication handler is required for token generation
      enableAuthEndpoint: false
      # path for authentication requests
      authPath: /auth
      # path for POST requests
      postPath: /
      # path for GET requests
      getPath: /
      # url path for http health-checks, GET requests to this path will return 200 if deepstream is alive
      healthCheckPath: /health-check
      # -- CORS --
      # if disabled, only requests with an 'Origin' header matching one specified under 'origins'
      # below will be permitted and the 'Access-Control-Allow-Credentials' response header will be
      # enabled
      allowAllOrigins: true
      # a list of allowed origins
      origins:
        - 'https://example.com'
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment