I have an Ionic project and I want it to work as if it is a web server (say mamp + php).
Since ionic is able to display a project in browser localy (using ionic serve), I am pretty sure it is able to do that. I have a simple ovh server.
How could I do that ?
edit: Ionic 1.2 officially supports deployment as a website! As I stated in the comment to the only provided answer - I disagree. If you're not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila - you'll have the same app.
Why Ionic? Embrace the power of the web. Progressive Web Apps use modern web capabilities to deliver fast, native-app experiences with no app stores or downloads, and all the goodness of the web. An escape hatch from the App Stores.
This plugin allows you to start a local dynamic content web server for android and iOS devices. Stuck on a Cordova issue? Don't waste precious time on plugin issues. If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Now your Ionic app is hosted on Firebase and uses a custom URL that you purchased wherever before. Great success! If you happen to have any kind of webserver up and running (or now how to start one) it’s actually super easy to deploy your Ionic app as a website as well.
You gonna need send all your project files (www folder) and dependencies to an web server.
You can try.
$ cd [ionic project]
$ ionic platform add browser
$ cd [ionic project]/platforms/browser/
and move your www folder to your server [webapp] folder.
In your server:
1.Install Node.js
Install connect and serve-static
$ cd [webapp] $ npm install connect serve-static
Create server.js file
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080)
Run serve
$ node server.js &
Now you can go to http://yourdomain:8080/index.html
I hope this can help you :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With