![]() ![]() Note that if you are not using the website's root directory you must rename theįolder in index.html from "/" to "/web/" (to match the name above, see eg.).Rename the web folder to whatever you like.On your server (for example on cPanel choose Extract from the File.Upload the web.zip file (ftp or file manager).One solution for those who use VPS/Shared hosting of any kind: Bookmark this and I will update with workarounds. Nota Bene - Using flutter 2.0 as of today, I am seeing a bug where the images are not uploaded. Or you can server your app through Dart pub/webdev tools by using the dhttpd package. “nohub” will let the command keep running even if you closed the SSH session on Linux. Just make sure you are in your web app folder when you run the command. ![]() Or if you don't want nodejs just use python in your flutter web app to serve it as a simple http server with this command nohup python -m SimpleHTTPServer 8000 & Var cookieParser = require('cookie-parser') Īpp.use(express.urlencoded()) Īpp.use(express.static(path.join(_dirname, 'public-flutter'))) Ĭreate a folder and name it (“public-flutter”) and then put your flutter web app in the folder you have just created so nodejs can serve it through his server if you are in a shared hosting just continue with the Blog Post hereĪnd if you are in a VPS server then run this command if you want to server the nodejs app node app.js You can deploy your flutter web app in a shared hosting with Nodejs or in VPS server with Python Follow this Medium Blog PostĪfter you build your flutter web app with "flutter build web" and you want to host it in a shared hosting plan prepare your nodejs app as a simple server for your flutter web app here is sample code I used the same way to deploy it to GitHub pages here's how in detail guide. You should see a build folder ( /build/web) in the root directory, just copy that folder and host it on a web server. Now go to the root folder of your project and do a build in release mode Open cmd/terminal run the below command to install webdev You need to provide the bin folder's path to the environment variable in order to use pub from cmd. So go to the location where you have dart SDK installed and inside the bin folder you should have a pub batch file. You need to do a production build by using a webdev tool, To create a production build for web, you can now directly run flutter build web command similar to other platforms (android and ios)Īnd you will see build/web folder generated with the assets folder and you can simply deploy it on your server. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |