Requests within ServerSideProps not working on Firebase Hosting with NextJS - google-cloud-firestore

My objective is to host my NextJS PWA on Firebase Hosting. Everything is working fine in development and even on production with Vercel but it doesn't work on Firebase Hosting. In ServerSideProps, I am trying to request data from the FireStore or from a third party(Nordigen).
All ServerSideProps are in the pages folder (Example of the codes of a ServerSideProps) . Not sure if it matters but some functions definition such as tokenhandler (see code above) are in another folder called utils (files path).
I have followed most guides on the web on how to deploy an nextjs app on Firebase Hosting.
From what I understood, those are the most important files for deploy NextJs on Firebase Hosting :
firebase.json
firebase.serc
server.js
next.config.js
Currently, everything is rendered from client side on Firebase Hosting but nothing from serversideprops side.
Does someone have an idea?

Related

How to save Flutter web file_picker selections to host directory

There are numerous examples online for using file_picker and uploading to Firestore, SQL etc; but it appears there are none for uploading right to the webhost directory where index.html is being served (i.e ./uploads).
As I am using flutter web in a corporate environment my options for spinning up remote storage options are nearly nil. I merely want my flutter web app to allow users to upload to our own environment (I host my web build off Sharepoint and it works perfect).
The solution for posting to web found here (https://stackoverflow.com/a/65759028/82856) is very close to what I need except for the http.MultipartRequest part as I don't have a server API listening for POST requests. What other options do I have for merely writing uploads to a directory like ./upload? Thanks in advance.

how to connect and deploy a flutter app to "real server" base on .netcore+iis+sqlserver

I have a project to make a website and application, and i did it by .net core and sql server and deploy it on iis and finally real server and special domain. Also i did my flutter app and tested it by url on local host ('http://192.168.1.110/project_Name/Controller/method_Name') to get connect with my database and it answered currectly,
But now i have a problem with my url to connect real server and create data on sql on server side(i can not find any special pattern to write url with domain-server-port and ...).
i dont know how to do it ,for example Should i add my fluttr app by iis or just change (new type of)url to get connection with my website backend ??
all of the sources learn about localhost.
could some one answer me about it or introduce appropriate source to guide??
One way to do that is to serve the flutter app as static files, you can achieve that by copying the output of flutter build web to the wwwroot folder of the ASP.Net core project should look something like this :
And then you need to serve it by adding the static files middleware in your request pipeline in your Startup.cs Configure method using the app.UseStaticFiles();
You should then access your flutter web application following the URL :
https://yourdomainname/index.html

Migrate ionic app in a server as a website

I have an ionic app that is connected to the mySQL database from a server and I want to migrate this app to the same server. I want to use this application as a website, which will continue to extract data from the mySQL database. How can I do that?
Thank you.
First I think you should probably split this into two projects:
the Ionic app, which communicates with the server via the API
the server side API (PHP file) with connection to the database
Usually these two would be in separate (Git) repositories.
You can then execute ionic build --prod to build the Ionic app for the web. The deployable files will be in the www directory once the command has finished. You can copy the files in this directory to a webserver like Apache or nginx, or you can easily deploy it to Firebase Hosting for example as well. It's just static files (HTML, CSS, JS, images, etc.).
You can find more information about deploying an Ionic app as a PWA (progressive web app) here. It also shows you how to deploy to Firebase Hosting, which has a free plan to get started with.

Using Firebase's reserved hosted URLs for local flutter development

I'm developing an app in flutter and deploying it to Firebase hosting.
Firebase hosting and the firebase serve command for local development let you initialize Firebase from a special auto-generated relative URL (/__/firebase/init.js).
This is nice because it allows me to share my project (on github, for example) without including my Firebase configuration.
Sadly, this does not seem to play nice with flutter run -- if I use flutter run, I lose the special URLs, and if I use firebase serve, I lose flutter's hot reload features.
My current workaround is to have the following local files under my app/web/ directory:
__/firebase/init.js # containing firebase.initializeApp(myFirebaseConfig);
__/firebase/7.1.44/firebase-app.js # manually downloaded from the gstatic cdn
__/firebase/7.1.44/firebase-auth.js
# ... (etc)
This works, but:
The __ directory actually gets deployed to Firebase. (Not actually a problem, but it seems wrong)
It's annoying to set this up manually in each local development environment.
Ideally, one should be able to firebase login, firebase init, and then flutter serve, and then automagically have access to the /__/ directory.
Is there already some way to make this happen, and if not, how could we implement it?
(For example, is there a way to extend flutter's local http server to take advantage of the logic that's already in the firebase-tools npm module?)

How to test SAPUI5 apps locally in apache tomacat installed in eclipse?

I am working on SAPUI5 app which was created long back and running successfully. Now I need to do some enhancements and for that I downloaded the app and uploaded in eclipse.
Now when I am running this app locally - It is not working as the XMLHTTP Request says 404 (Not Found) when accessing the backend OData service.
URI is : /sap/opu/odata/sap/Z****SRV";
I understand that I need to add http://<host>:<port> before URI.
But I cannot change it in all the places. I found out that we can write <param-value> in web.xml file but I did and still it is not working
Can someone guide me how?