Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lddubeau/karma-serve-static-map
Individually map multiple locations on the local filesystem to multiple base URLs in Karma.
https://github.com/lddubeau/karma-serve-static-map
Last synced: 1 day ago
JSON representation
Individually map multiple locations on the local filesystem to multiple base URLs in Karma.
- Host: GitHub
- URL: https://github.com/lddubeau/karma-serve-static-map
- Owner: lddubeau
- Created: 2019-01-31T20:45:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-10T19:42:17.000Z (17 days ago)
- Last Synced: 2024-12-10T20:34:41.289Z (17 days ago)
- Language: JavaScript
- Size: 1.34 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# karma-serve-static-map
Individually map multiple locations on the local filesystem to multiple base
URLs in Karma.Under the hood, this plugin uses the [serve-static
middleware](https://github.com/expressjs/serve-static).## Installation
Install ``karma-serve-static-map`` as a ``devDependency`` in your package.json:```bash
npm i -D karma-serve-static-map
```## Usage
```
module.exports = function configure(config) {
config.set({
middleware: ["serve-static-map"],
serveStaticMap: [
{ fsPath: ".", baseURL: "/fnord/" },
{ fsPath: "./test", baseURL: "/foo/" },
],
});
};
```The ``serveStaticMap`` configuration option is an array whose elements sets up a
mapping from a URL to a file system location. Each element has the fields:* ``fsPath``: this is the location in the file system from which to serve files
It must be a directory. These paths are resolve relative to the ``basePath``
of the Karma configuration.* ``baseURL``: the URL at which the static files are anchored. This is
interpreted as a directory by ``serve-static-map``.