Skip to content

How to get heroku port number? #1

Description

@far11ven

How to get heroku port number?

How to specify on which this app runs on?

Like in folowing example present on https://deno.land

import { serve } from "https://deno.land/std@v0.30.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
req.respond({ body: "Hello World\n" });
}

In NodeJs we had something like below:

.listen(process.env.PORT || 5000); what;s in deno?

2020-02-15T14:23:46.284551+00:00 heroku[web.1]: Starting process with command deno -A --allow-net=:8000 index.ts
2020-02-15T14:23:45.139667+00:00 app[api]: Release v5 created by user fa.123@gmail.com
2020-02-15T14:23:45.000000+00:00 app[api]: Build succeeded
2020-02-15T14:23:47.827365+00:00 app[web.1]: Compile file:///app/index.ts
2020-02-15T14:23:51.050050+00:00 app[web.1]: Listening on http://localhost:8000/
2020-02-15T14:24:46.783798+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-15T14:24:46.705630+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-02-15T14:24:46.705723+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-02-15T14:24:46.768561+00:00 heroku[web.1]: Process exited with status 137
2020-02-15T14:24:49.248590+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=deno-http-server.herokuapp.com request_id=546fb246-b75e-4f4b-b47f-6a32eeee3095 fwd="103.251.211.59" dyno= connect= service= status=503 bytes= protocol=https

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions