0.2.4 • Published 10 years ago

express-webapp-host v0.2.4

Weekly downloads
2
License
-
Repository
github
Last release
10 years ago

express-webapp-host

Simple express middleware to host a static directory under a deeper url by rewriting the webapps index.html base tag

index.html

The index.html base tag must be present.

<meta charset="utf-8">
<base href='http://localhost:8888/' />
<title>My App</title>

It will be rewritten to the actual base path. Using the express example below when access via localhost it would rewrite it to:

<meta charset="utf-8">
<base href='http://localhost:8080/url/to/app/' />
<title>My App</title>

All url in the app should be relative paths.

usage with express

var webAppHost = require('express-webapp-host');
var express = require('express');
var app = express();

app.use('/url/to/app/', webAppHost.webApp('./path/to/app/on/disk'));
app.listen(8080)

angular.js

In combination with angular.js it is now possible to deep link when using Html5 Mode

$locationProvider.html5Mode(true);

Make sure all paths are relative unless you explicitly want to leave the sub location ('/url/to/app/' in the example above)

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago