Skip to content

Scala-Dev/cordova-plugin-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-nginx

Application Build Manual

You may use cordova CLI as follows:

➜ cordova plugin add https://github.com/ScalaInc/cordova-plugin-nginx

Install build tools

Install following build tools.

name value
HOME your home directory
ANDROID_HOME Android SDK install path
ANDROID_NDK_HOME Android NDK install path

And, make standalone toolchain.

#!sh
% $ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.sh \
    --platform=android-19 --install-dir=$HOME/local/android-toolchain

Configuration nginx core and modules

Connect android device with USB cable, or launch android emulator.

Run command to configure nginx core and libraries.

#!sh
% cd jni/nginx

% auto/configure \
    --crossbuild=android-arm \
    --prefix=/sdcard/nginx \
    --with-cc=$HOME/local/android-toolchain/arm-linux-androideabi/bin/gcc \
    --without-pcre --without-http_rewrite_module --without-http_userid_module \
    --with-cc-opt=-Wno-sign-compare

Application Usage

Use application

Nginx needs config files and logs directory to run. Please copy sdcard/nginx to /sdcard/nginx in the android device.

/sdcard
    +-- nginx/
          +-- conf/
          |     +-- nginx.conf
          |     +-- mime.types
          |
          +-- html/
          |     +-- index.html
          |     +-- 50x.html
          |
          +-- logs/

After that cordova run android and go to http://localhost:8080/ with web browser.

Sample code

document.addEventListener('deviceready', onDeviceReady);
function onDeviceReady()
{
        var success = function(status) {
            alert('Message: ' + status);
        }

        var error = function(status) {
            alert('Error: ' + status);
        }

        window.expnginx.start( success, error );
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published