Leo
Leo

Reputation: 4428

firebase serve, emulator port for hosting?

I just added new Firebase project with the following in firebase.json:

  "emulators": {
    "functions": {
      "port": 5001
    },
    "hosting": {
      "port": 5002
    },

I started it with firebase serve. And it serves hosting on port 5000 (instead of 5002):

+  hosting: Local server: http://localhost:5000

Am I doing something wrong?

Upvotes: 1

Views: 1605

Answers (1)

Methkal Khalawi
Methkal Khalawi

Reputation: 2477

firebase.json file doesn't work with the the firebase serve command. You have to use the firebase emulators:start command.

If you want to keep using firebase serve then it should be use like in:

firebase serve --only hosting --port=5002

Upvotes: 6

Related Questions