How to use the cordova-serve.static function in cordova-serve

To help you get started, we’ve selected a few cordova-serve examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-lib / src / cordova / serve.js View on Github external
function platformRouter (platform) {
    const { configXml, www } = platforms.getPlatformApi(platform).getPlatformInfo().locations;
    const router = cordovaServe.Router();
    router.use('/www', cordovaServe.static(www));
    router.get('/config.xml', (req, res) => res.sendFile(configXml));
    router.get('/project.json', (req, res) => res.send({
        configPath: `/${platform}/config.xml`,
        wwwPath: `/${platform}/www`,
        wwwFileList: generateWwwFileList(www)
    return router;
github apache / cordova-lib / cordova-lib / src / cordova / serve.js View on Github external
installedPlatforms.forEach(function (platform) {
                var locations = platforms.getPlatformApi(platform).getPlatformInfo().locations;
      '/' + platform + '/www', serve.static(locations.www));
      '/' + platform + '/*', getPlatformHandler(platform, locations.www, locations.configXml));


Apache Cordova server support for cordova-lib and cordova-browser.

Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis

Popular cordova-serve functions