KiriakiK
KiriakiK

Reputation: 23

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.

Upvotes: 0

Views: 671

Answers (1)

Klemens Zleptnig
Klemens Zleptnig

Reputation: 1824

First I think you should probably split this into two projects:

  1. the Ionic app, which communicates with the server via the API
  2. 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.

Upvotes: 1

Related Questions