Web Server for Progressive web apps - progressive-web-apps

I am a beginner to developing a Progressive Web Apps, as i have used Chrome Web Server initially to host my progressive web application.But i don't know how to host my PWA app on other web server.
Your help will be appreciated!

Get a GitHub account, install GitHub software, and commit some code to your repo
Get a free Heroku account, and install Heroku CLI on your computer.
Point your Heroku account, in its configuration, to your Git repo's master branch
If your app consists of static files, follow the following instructions (Heroku only hosts non-static sites):
Add a file called composer.json to the root directory by running:
touch composer.json
Add a file called index.php to the root directory by running:
touch index.php
Rename the homepage (e.g. index.html) to home.html
In index.php, add the following line:
<?php include_once("home.html"); ?>
In composer.json, add the following line:
{}
From a command line, CD into your project's root directory. Run the following command:
git push heroku master
You should now have a staging server on Heroku, with https enabled. Whenever you commit code to your master branch and sync it with GitHub.com, there will automatically be a deployment behind the scenes from your GitHub repository to your Heroku hosting account. Boom! You have all the ingredients you need to stage a successful PWA application. Production hosting is up to you, maybe try DigitalOcean to start with.

Related

How to deploy flutter web on Heroku

I built a web application in Flutter and run the command flutter build web successfully. I'm trying to find a way to deploy it on Heroku like my react applications but found nothing in Heroku documentation.
we run flutter web or static page run with the help of php.we can use many other language .we can simply use php without any more work.
First
create app in heroku after this will shown .
after run flutter build web in the root of the project folder it will generate static content in build/web .copy the file to any other directory and open cmd like this
create two file index.php and composer.json
in index.php
add this
<?php include_once("index.html");
in composer.json
add this (braces)
{}
after run the command in the
`heroku login`
heroku git:clone -a appname
git add .
git commit -am "make it better
git push heroku master
after running this it may be show any error .if not show any error
run this https://appname.herokuapp.com/#/ .your website will be live.
Try these simple steps.
first, you need to create your app on Heroku, after typing the commands in your project directory console
heroku login
git init
heroku git:remote -a [your app name in heroku]
git commit -m "[your commit message]"
heroku buildpacks:set diezep/flutter -a [your app name]
git push heroku master

deploy react app on github gh-pages

when I'm trying to deploy react app on gh-pages it gives me this error
I could not deploy my react app on gh-pages github because I was using windows. on Ubuntu works fine.
Another alternative (whilst not as nice as being able to run npm run deploy is to manually add the build folder to a git repository and then set up GitHub pages via the website in Settings -> GitHub Pages

Import existing file folder to IBM Watson Application

I have downloaded on my PC this IBM Watson project:
https://github.com/watson-developer-cloud/conversation-simple/
and following its tutorial I've uploaded it on my IBM dashboard.
The problem is that everytime I want to change somethink in the project I've to re-upload it with the command line command cf push.
When I go in the Toolchain section, I can't see all the files and their folders, but only create a new repository or clone it, but in both case I haven't resolved my problem.
How can I resolve this problem?
Try to use:
cf push APP_NAME
Obs.: cf push does not support incremental upload. It will simply push everything in the folder to the cloud.
If your node_modules in the folder which resulted in a large-size upload. Try to specify what to exclude in a .cfignore file.
Example .cfignore file contents:
tmp/
node_modules/
my_unnecessary_file.txt
When executing your next cf push for deploying the application it will omit the files and directories listed in your .cfignore file.
See more about CF PUSH.
See more deploy applications with CF CLI.
It doesn't change anything, because when you create a toolchain it ask you to select between:
- New
- Clone
- Fork
and I tried all these options but going in the web eclipse editor files don't appear.
This s the git repository of my app:
https://git.ng.bluemix.net/consultagiovanilepolizzi/official-app2
How can I import with Git an existing project in my computer to edit it with toolchain?
As it seems that you are working with the Continuous delivery, instead of uploading your app using cf push, you are going to use the toochain.
The fist step is to use the git repository, you need to create a ssh key or an access token, if you prefer to connect through https, the access token can be created in the Bluemix git, going into the settings of your user, then Access Tokens
After that, you can push your app to the repository using a git tool, the user name will be your IBM account, and the password your token.
In the delivery pipeline, the build stage checks you repository for new commits into the master, by default, and start a new build, sending to the deploy if successful.
Those links below can give you more details
Using git Repos
Setting up local clients
Delivery Pipeline

Mercurial deployment

I'm quite new to mercurial so this might sound silly..
I am developing a PHP application locally and pushing changes to remote linux server. I have a hgweb.wsgi script publishing my repository which is accessible via url (hg.example.com/repository).
Now I am wondering what is the best way to automate deployment of the app to see it in action on the same server as repository? Obviously I can't just go to hg.example.com/repository since it just shows the web interface of the repository and not the app..
You're mixing up two things which are not necessarily related:
the path part of the URL of your repository, and
the path of the actual repository on your server.
To get a better picture, consider we use SSH, not HTTP, for repository access. This means we probably specify the full path to the repo in the server file system within the path, e.g., to sync with my server in a similar setup, I push to ssh://example.com//var/www/wsgi/example.com (I have a WSGI app, not a PHP one, but that's not important now). The app itself is available at http://example.com/, i.e., site root if /var/www/wsgi/example.com.
Well now, nothing can prevent me to set up HTTP access to this repo using hgweb on a hg.example.com subdomain, so the repo push path is http://hg.example.com/example.com.
Thus:
I push to http://hg.example.com/example.com (repo pulished at this URL)
The repo is located under /var/www/wsgi/example.com (server file system path)
This directory is in some way set up to be considered the site root by the web server
Site root = http://example.com/
P.S. Don't forget about the changegroup hook Ton mentioned.
There are two things you'll need to do:
Add a webserver that can serve PHP-pages (like apache) and let it serve the repository root (as always make sure it's save)
Add a hook to the mercurial server for the changegroup hook. This hook can be as simple as:
update.changegroup = hg up
That will update the working folder of the repository with the latest version.

Heroku and Github integration (how to structure the project)

I'm creating a webservice and I want to store the source on github and run the app on heroku. I haven't seen my exact scenario addressed anywhere on the 'net so far, so I'll ask it here:
I want to have the following directory structure:
/project
.git
README <-- project readme file
TODO.otl <-- project outline
... <-- other project-related stuff
/my_rails_app
app
config
...
README <-- rails' readme file
In the above, project corresponds to http://github.com/myuser/project, and my_rails_app is the code that should be pushed to heroku. Do I need a separate branch for the rails app, or is there a simpler way that I'm missing?
I guess my project-related non-rails files could live in my_rails_app, but the rails README already lives there and it seems inconsistent to overwrite that. However, if I leave it, my github page for the rails app will contain the rails readme, which makes no sense.
Also ... I tried just setting it up as described above and running
git push heroku
from the main project folder. Of course, heroku doesn't know I want to deploy the subfolder:
-----> Heroku receiving push
! Heroku push rejected, no Rails or Rack app detected.
Here's a simple solution that may or may not work for you.
Create two projects on GitHub. One project should be just the Rails app (i.e. everything inside the Rails app directory). The other project should be everything outside the Rails app directory.
Add the Rails app project as a git-submodule within the "container" project.
Now you can add Heroku as a remote on the Rails app repository separately and push it to heroku. Heroku will accept the push because it is just a Rails app with the expected directories and files.
A solution for the Heroku situation (not the README file):
If you're using the new Heroku Cedar (I believe it wasn't available when you first asked your question) then your processes (like the rails server process) start up using Foreman. Thus, you can place a Procfile in the root github directory that looks like this:
web: my_rails_app/script/runserver.sh
And then my_rails_app/script/runserver.sh could be a simple
#!/bin/sh
cd my_rails_app
bundle exec rails server -p $PORT
Locally, you should also create a file called .env (note the . at the beginning), which contains
PORT=3000
This file is read by foreman and used to set environment variables so that the port is set when you execute foreman start on your machine (from the root github directory, where the Procfile lies). The Heroku server takes care of the .env file on your dyno. The big advantage is you can set up multiple processes on the dyno that way!
Just overwrite Rails' default README file. There's no reason to keep it around. Put your other project-management-related stuff in the doc directory. While you certainly have valid reasons for wanting to set it up the way you did, you're just creating a headache for yourself by going against convention, and it's probably not worth the benefit.
I would add everything underneath /my_rails_app to the Heroku git repository. Then add GitHub as a remote and add everything underneath /project to the GitHub repository. Then you can push the Rails application to Heroku (from /my_rails_app) and push the full project to GitHub (from /project).