Httpd

Contents

Embedded httpd for Cordova apps. Light weight HTTP server.

https://github.com/floatinghotpot/cordova-httpd

Ionic 服务器Httpd插件的安装(Installation)

ionic cordova plugin add cordova-plugin-httpd npm install @ionic-native/httpd

Ionic 服务器Httpd插件支持的平台(Supported Platforms)

  • Android
  • iOS
  • macOS

Ionic 服务器Httpd插件的用法(Usage)

import { Httpd, HttpdOptions } from '@ionic-native/httpd';

constructor(private httpd: Httpd) { }

...


let options: HttpdOptions = {
     www_root: 'httpd_root', // relative path to app's www directory
     port: 80,
     localhost_only: false
 };

this.httpd.startServer(options).subscribe((data) => {
 console.log('Server is live');
});