Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pawsong/angular-html5-proxy
Simple express proxy middleware for angular html5mode
https://github.com/pawsong/angular-html5-proxy
Last synced: 10 days ago
JSON representation
Simple express proxy middleware for angular html5mode
- Host: GitHub
- URL: https://github.com/pawsong/angular-html5-proxy
- Owner: pawsong
- Created: 2015-04-05T16:31:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-02T07:45:07.000Z (over 9 years ago)
- Last Synced: 2024-10-14T11:07:33.581Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 367 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# angular-html5-proxy
Simple express proxy middleware for angular html5mode
[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]```js
var express = require('express'),
proxy = require('angular-html5-proxy');app.use(proxy({
target: 'http://my-angular.static-server.com',
extensions: ['mp3']
}));app.listen(3000);
```## What is this?
From the angular docs about html5mode
> #### Server side
>
> Using this mode requires URL rewriting on server side,
> basically you have to rewrite all your links to entry point of your application (e.g. index.html).
This is the server side! angular-html-proxy rewrites url of each request and sends it to the original static server.## Installation
```bash
$ npm install angular-html5-proxy
```## Options
### target
Type: `String`
Proxy target URL. Must contain protocol(ex. http://)
### extensions
Type: `Array`
Additional file extensions to serve. Followings are default extensions:
- html
- js
- svg
- css
- png
- jpg
- eot
- ttf
- woff
- woff2
## ExampleHere is a simple server implemetation using angular-html5-proxy:
[angular-simple-server](https://github.com/gifff/angular-simple-server)## Tests
To run the test suite, first install the dependencies, then run `npm test`:
```bash
$ npm install
$ npm test
```## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/angular-html5-proxy.svg
[npm-url]: https://npmjs.org/package/angular-html5-proxy
[travis-image]: https://travis-ci.org/gifff/angular-html5-proxy.svg?branch=master
[travis-url]: https://travis-ci.org/gifff/angular-html5-proxy