How can I serve index.html file located in my blog folder by using a firebase function.
Here is my file tree
FirebaseWebsite
│
├── blog
│ ├── index.html
│ ├── css
│ │ ├── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ └── fontawesome-webfont.woff
│ │ ├── images
│ │ │ └── banner.jpg
│ │ └── style.css
│ ├── fancybox
│ │ ├── blank.gif
│ │ ├── fancybox_loading.gif
│ │ ├── [email protected]
│ │ ├── fancybox_overlay.png
│ │ ├── fancybox_sprite.png
│ │ ├── [email protected]
│ │ ├── helpers
│ │ │ ├── fancybox_buttons.png
│ │ │ ├── jquery.fancybox-buttons.css
│ │ │ ├── jquery.fancybox-buttons.js
│ │ │ ├── jquery.fancybox-media.js
│ │ │ ├── jquery.fancybox-thumbs.css
│ │ │ └── jquery.fancybox-thumbs.js
│ │ ├── jquery.fancybox.css
│ │ ├── jquery.fancybox.js
│ │ └── jquery.fancybox.pack.js
│ ├── js
│ │ └── script.js
│ └── tags
│ └── Topic-for-blog
│ └── index.html
├── index.js
│
├── functions
│ └── index.js
│
├── Public
│ └── aboutUs.html
│
└── firebase.json
Here is the firebase function that I am using
index.js (from functions folder)
const functions = require('firebase-functions');
const express = require('express');
const blogApp = express();
blogApp.get('/blog', (request, response) => {
response.sendfile('../blog/public/index.html');
});
exports.blogApp = functions.https.onRequest(blogApp);
Below is the configuration
firebase.json
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"rewrites": [
{
"source": "/blog",
"function": "blogApp"
}
],
"cleanUrls": true
}
}
Below is the error that I am getting when I visit the url
Refused to load the image '' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
Any guidance on resolving this issue would be greatly appreciated.