docs
This commit is contained in:
8
example/built-in/rewrite/.local-web-server.json
Normal file
8
example/built-in/rewrite/.local-web-server.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"rewrite": [
|
||||
{ "from": "/css/*", "to": "/build/styles/$1" },
|
||||
{ "from": "/npm/*", "to": "http://registry.npmjs.org/$1" },
|
||||
{ "from": "/broken/*", "to": "http://localhost:9999" },
|
||||
{ "from": "/:user/repos/:name", "to": "https://api.github.com/repos/:user/:name" }
|
||||
]
|
||||
}
|
4
example/built-in/rewrite/build/styles/style.css
Normal file
4
example/built-in/rewrite/build/styles/style.css
Normal file
@ -0,0 +1,4 @@
|
||||
body {
|
||||
font-family: monospace;
|
||||
font-size: 1.3em;
|
||||
}
|
24
example/built-in/rewrite/index.html
Normal file
24
example/built-in/rewrite/index.html
Normal file
@ -0,0 +1,24 @@
|
||||
<head>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
</head>
|
||||
<h1>Rewriting paths</h1>
|
||||
|
||||
<h2>Config</h2>
|
||||
<pre><code>
|
||||
{
|
||||
"rewrite": [
|
||||
{ "from": "/css/*", "to": "/build/styles/$1" },
|
||||
{ "from": "/npm/*", "to": "http://registry.npmjs.org/$1" },
|
||||
{ "from": "/broken/*", "to": "http://localhost:9999" },
|
||||
{ "from": "/:user/repos/:name", "to": "https://api.github.com/repos/:user/:name" }
|
||||
]
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<h2>Links</h2>
|
||||
<ul>
|
||||
<li><a href="/css/style.css">/css/style.css</li>
|
||||
<li><a href="/npm/local-web-server">/npm/local-web-server</a></li>
|
||||
<li><a href="/broken/">/broken/</a></li>
|
||||
<li><a href="/75lb/repos/work">/75lb/repos/work</a></li>
|
||||
</ul>
|
Reference in New Issue
Block a user