Express app using firebase functions

0

I'm setting up an express app in firebase functions

The application is running correctly in the next url

  

link

But I want to make it run in this url, just like in the official Firebase tutotial on youtube

  

link

What am I doing wrong? this is index.js

const functions = require('firebase-functions');

const express = require('express')
const app = express()

app.get('/test', (req, res) => {
    res.send('Well if i'm reading this the app is working')
})


exports.app = functions.https.onRequest(app)

And this: firebase.json

{
  "hosting": {
    "public": "public",
    "rewrite":[{
      "source": "/test",
      "function": "app"
    }],
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

If I enter directly to "localhost: 5000 / test" I am redirected to 404.html in the public folder, thanks for reading.

    
asked by Sebastian Altamirano 21.05.2018 в 06:03
source

0 answers