Skip to content

Freeze an Express.js application into a set of static files

Notifications You must be signed in to change notification settings

prestifidibs/frozen-express

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frozen Express

Frozen Express generates a collection of static files for an Express.js application allowing to host said application easily and cheaply.

Express 4 and Express 3 applications are supported.

Build Status Code Climate Coverage Status bitHound Score Dependency Status

Usage

You can use Frozen Express as a command line tool or access it programatically.

Command line

Once you install Frozen Express (npm install -g frozen-express), you can use it as follows:

frozen-express app.js dist

Here the app.js is your module that exports the application, and dist is the directory to put the generated files.

Most Frozen Express options are available as command line options, use frozen-express -h to see their usage.

API

var frozen = require('frozen-express');

var stream = frozen(app);

You can do with the generated Stream whatever you want, but the simplest thing is to use gulp-dest:

var gulp = require('gulp');
var frozen = require('frozen-express');

frozen(app).pipe(gulp.dest('./dist'));

You can also include it in your Gulp workflow and perform more tasks with files.

Options

Frozen Express supports a number of options:

var stream = frozen(app, {
    // Apache specific settings
    // Use only if server is set to apache
    apache: {
        // Any custom .htaccess content to append to the generated file
        extraHtaccess: '',
    }

    // Base URL for the website relative to domain root
    // Required if server is set to apache
    // Use a single slash if the website will be hosted in the domain root
    base: '/subdir/',

    // Add control files for serving the application with a particular server
    // Valid options: 'apache'
    server: false,

    // A list of URLs to freeze
    // By default Frozen will try to detect the URLs itself
    urls: ['/', '/about', '/contact']
});

About

Freeze an Express.js application into a set of static files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%