e
This commit is contained in:
parent
6199adb581
commit
cddcdb3e9a
2 changed files with 30 additions and 2 deletions
31
README.md
31
README.md
|
|
@ -1 +1,30 @@
|
|||
# Ultraviolet Frontend
|
||||
# ultraviolet-scripts
|
||||
Core Ultraviolet scripts
|
||||
|
||||
# Configuration
|
||||
Configure Ultraviolet for both client-hooking & service worker in `uv.config.js`
|
||||
```javascript
|
||||
self.__uv$config = {
|
||||
bare: '/bare/',
|
||||
prefix: '/service/',
|
||||
encodeUrl: Ultraviolet.codec.xor.encode,
|
||||
decodeUrl: Ultraviolet.codec.xor.decode,
|
||||
handler: '/uv.handler.js',
|
||||
bundle: '/uv.bundle.js',
|
||||
config: '/uv.config.js',
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
# Example Usage
|
||||
```javascript
|
||||
importScripts('/PATHTOSCRIPTS/uv.sw.js');
|
||||
|
||||
const sw = new UVServiceWorker();
|
||||
|
||||
self.addEventListener('fetch', event =>
|
||||
event.respondWith(
|
||||
sw.fetch(event)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
|
|
|||
1
uv
1
uv
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 1684b5a0fce91c78277dfa9a98a4f7d3aff66428
|
||||
Loading…
Add table
Reference in a new issue