We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a need for the API that will just use the same request but to the server. This similar to #22 that is not enough.
Consider code of syntax highlighting:
app.get('*', async function(req, res) { const url = new URL(req.url); const extension = path.extname(url.pathname).substring(1); const language = language_map[extension]; const accept = req.headers.get('Accept'); if (language && Prism.languages[language] && accept.match(/text\/html/)) { const code = await fetch(req.url).then(res => res.text()); const grammar = Prism.languages[language]; const tokens = Prism.tokenize(code, grammar); const output = Prism.Token.stringify(tokens, language); res.html(`${style}\n<pre><code class="language-${language}">${output}</code></pre>`); } else { const fetch_res = await fetch(req.url); res._resolve(fetch_res); } });
from gh-pages branch: sw.js.
So there is a need to use hidden _resolve method that accept response object.
_resolve
The text was updated successfully, but these errors were encountered:
It seems that there is already:
res.fetch(req.url);
But it would be better to use a request object that have all the headers not only URL.
So the fetch need to be overloaded.
Sorry, something went wrong.
No branches or pull requests
There is a need for the API that will just use the same request but to the server. This similar to #22 that is not enough.
Consider code of syntax highlighting:
from gh-pages branch: sw.js.
So there is a need to use hidden
_resolve
method that accept response object.The text was updated successfully, but these errors were encountered: