-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add redirect resolver controlled by server (#46)
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/*.adv.js | ||
/node_modules/ | ||
/public/ | ||
/gostatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
id: server-redirect | ||
title: Redirect from server | ||
tags: ts-location | ||
---- | ||
<p> | ||
Redirect to target url, pass to response headers <code>ts-location</code> parameter. | ||
</p> | ||
|
||
|
||
<div class="card example"> | ||
<div class="card-header"> | ||
<h5 class="d-inline mr-2">Demo</h5> | ||
<button class="btn btn-link btn-sm reset">Reset</button> | ||
<button class="btn btn-link btn-sm source">View Source</button> | ||
</div> | ||
|
||
<div class="card-body" style="margin-bottom: 1.2rem" id="redirect-example"> | ||
<button class="btn" ts-req="/redirect" > | ||
Click to redirect | ||
</button> | ||
</div> | ||
|
||
<script> | ||
XHRMock.get("/redirect", | ||
{body: prev(), | ||
headers: {'ts-location': 'https://github.com/piranha/twinspark-js'}}); | ||
</script> | ||
</div> |