How to access this kinds of links: https://127.0.0.1:3000/location/test?

I have exposed port 3000 on the .gitpod.yml file. however, I still get "Port 3000 Not Found

Please make sure this port is exposed and your application is up and running." how can I access this link: https://127.0.0.1:3000/location/test I changed HTTP to HTTPS but no success?

Hi

how do you expose the port?

like this?

ports:
  - port: 8080

and: where do you want to open the link? in vscode-preview-browser inside gitpod or … ?

yes i exposed it like that I even tried

ports:
  - port: 3000-8999
    onOpen: preview(forgat the exact keyword but it has preview on it)

how it opens? dsn’t matter would like it to open on a new tab. for reference: this is the project link: https://github.com/XRFoundation/XREngine

if you open it in a new tab (local browser) you can not access it through 127.0.0.1 (i assume, the devserver is running in gitpod).
you have to use the gitpod link

for example: for my project the url ist something like this:
https://8090-teal-tortoise-hkr1j0lw.ws-eu16.gitpod.io

yes, i used the generated link from gitpod here is my link:
https://3000-beige-locust-l4vunq1z.ws-eu16.gitpod.io/

can you tell me on which branch the .gitpod.yaml file is located? can’t see it on dev-branch or master.

if you just created it in you current branch, not pushed it - as far as i know you have to generate the file (commit&push) and start a new workspace

didnt commit or pushed anything. was just trying gitpod. Btw I am the only one using the repo on gitpod so don’t expect to see .gitpod file on master/dev.

ah ok i bet this the “error” .gitpod.yml has to exist when you start a workspace to be executed.
so: start workspace, create .gitpod.yml, push, close workspace and start a new workspace (with the newly created .gitpod.yml)

hope this is helpfull :slight_smile:

edit:: just looked it up again: Getting Started “Commit .gitpod.yml” section explains it

@porkus1990 Thank you that was very helpful. But still it didn’t work for me


. you can find my branch here: https://github.com/YosanAI/XREngine

once in the workspace you need to:
1 update node to 16.9.1 (npm 7+)
2 npm install
3 npm run dev

I know this would be too much, but if it all went well for you, can u make a branch that automates the above 3 steps and share your branch here? 2 and 3 are easy for me but i am not familiar with docker.

no problem i’d like to help. but i have no permissions to create new branch - tried it in github and with the console in a running gitpod instance :slight_smile:

but you can have a look at my config file
https://github.com/porkus1990/q/blob/master/.gitpod.yml << init and command part (and line 2 for using a custom dockerfile)
https://github.com/porkus1990/q/blob/master/.gitpod.Dockerfile << here i’m installing the node version i’d like to use

thank you. I am new to git and node so sorry if i am not using the right words.
why is your Port: 8080 and not 3000?
why number 14 in this command RUN bash -c ". .nvm/nvm.sh && nvm install 14 && nvm use 14 && nvm alias default 14"i need node 16+

no problem :slight_smile:

these are the config files for my project - not yours :slight_smile: . i thought i show you my config and you can adapt it for your project though i have no rights (i’m not allowed to) to commit/push or to create a new branch in your project - so i can not make any changes to your project.

what i would do is: create a .gitpod.Dockerfile copy&paste the content of my .gitpod.Dockerfile (from one of the links i posted above) and change 14 to 16.9.1 (or whatever version you like to use)

adapt my config from my .gitpod.yml (especially line 2 for using the custom dockerfile), change line 14 to npm run dev and change the port to 3000

i hope it’s helpfull :slight_smile:

It still dsnt work this is getting frustrating:

my .gitpod.yml

image:
  file: .gitpod.Dockerfile
github:
  prebuilds:
    master: true
    branches: true
    pullRequests: true
    addCheck: true
    addComment: true
    addBadge: true
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
tasks:
  - init: npm install
    command: npm run dev

# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
ports:
  - port: 3000
    onOpen: open-preview

my .gitpod.Dockerfile

FROM gitpod/workspace-full:latest

RUN bash -c ". .nvm/nvm.sh && nvm install 16.9.1 && nvm use 16.9.1 && nvm alias default 16.9.1"

RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix

as far as i can see, there are many ports you should add to the ports section

but i don’t know your project and the services - maybe they depend on each other ?

I think this is the problem. the doc mentions:

Ports are mapped to their own URLs. In a workspace you can get the URL mapped to a port using gp url <port> . At the moment you can only expose HTTP servers.

but the port is launched with https

hm seems bad …
maybe there is already an issue - if not, you can create one :slight_smile:

1 Like

Your application seems to be running on ports 9357 and 9358

EDIT: I mean those are only two ports on which content is served as far as I can tell.