Ember app Firebase static file location - firebase

Can anyone tell me where is my static file located in Firebase if I deploy ember app to Firebase? In my local drive, the static file is under public/assets/ like xxx.pdf ;
BTW everything works as it's meant to be whether locally or from Firebase URL. I just wonder where is the file, so that I can replace/modify directly on Firebase if possible.

When you build your ember app to production on Firebase, all static files are transferred as they are into your public directory which is dist so public/assets/xyz.pdf will be at assets/xyz.pdf in relative to the app root directory.

Related

firebase hosting public path in nest.js

I'm trying to deploy my nest.js project to firebase hosting. i tried setting the public path to dist , it deploes successfuly but none of the routes work. so i suppose I have to refer to another folder other than dist. any ideas ?

Next.js production mode public folder can't access dynamically [duplicate]

I have a project in Next.js. I have that upload files and share that in public URL to this project.
With npm run dev first I uploaded files to public folder and it worked fine, but when I change to npm run start and upload files, the files upload to public folder but with URL http://mydomain/fileuploaded.jpg it did not show, is rare but it's there.
I searched on the Internet but I didn't find a solution for this problem.
From Next.js documentation:
Only assets that are in the public directory at build time will be served by Next.js. Files added at runtime won't be available.
You'll have to persist the uploaded files somewhere else if you want to have access to them in the app at run time.
Alternatively, you could setup your own custom server in Next.js, which would give you more control to serve static files/assets.
You can also achieve something similar using API routes instead. See Next.js serving static files that are not included in the build or source code for details.
a bit late but if someone need the same.
If your goal is to upload and get picture from your next server, you can instead of using the Next router, getting the image by yourself by create a route /api/images/[id] where [id] is your file name and you manually with fs send the picture back.
something like:
const file = await fs.readFile(`./uploads/image.png`)
console.log(file)
res.setHeader('Content-Type', 'image/png')
res.send(file)
Try and use nginx or another webserver to serve the public directory. That way it will serve newly added files without having to write extra code to serve files in nextjs.
server {
/images/ {
root /var/www/site/public
}
}

Firebase hosting application deploy

I tried to deploy my application using Firebase (in build folder I have an index.html file) but I get the following error:
Does anyone know what might had gone wrong?
That's actually the default content in the automatically generated index.html file by the Firebase CLI when you initialize your project. That's not an error; If you already have HTML ready to go, just paste it inside the index.html file inside your build folder.
Your screenshot is showing the local index.html file, make sure to deploy your site by running firebase deploy --only hosting; And also double check your public attribute within your firebase.json file is configured to take the build folder.

Is there any way to use Firebase hosting/platform for an ACTUAL working website written in ejs?

So I know perfectly well how to use Firebase hosting and platform for a website code file such as index.html or app.js(in this case, use Cloud Functions). But what about a website that has zero code in html but only ejs code ? I tried running Firebase for it and it didn't work because Firebase could not find any index.html file sitting in Public folder because there was no html file to begin with and then when Firebase searched for app.js file in functions folder, it failed as well because there was no file with the extension ".js". So is there no way to run a website purely written in an ejs file?
I don't think EJS is supported in Firebase hosting. You'd have to host your own Express site elsewhere

Firebase Deployed URL not working?

So I have built a simple firebase and javascript app that uses firebase database and hosting.
I have successfully built the app and deployed to Firebase hosting, however when the cmd provides the url that leads to the app it takes me to some completely random firebase landing page.
All deployment is correct and I know all my code is correct, but it keeps sending me to the random landing page: https://firebase.google.com/docs/hosting/
When you first create a project on firebase it asks you for the public directory: What do you want to use as your public directory? public
Usually the default its public, so the firebase generates a random welcome index.html there.
When you setup the firebase init configure the public directory to your files and you should see your app instead of the welcome index file, or simply put all your files inside the public directory you've chosen above.
Here I found a very simple tutorial on how to get started on that: https://www.brooks-patton.com/deploying-a-static-website-to-firebase/
Another way - you can just edit firebase.json file, in the line with "public" change the path where is your code was built.

Resources