mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 20:14:39 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
499b377bfd | ||
|
|
1baeb79d4b | ||
|
|
0cc5ff95d6 | ||
|
|
e90525c1e8 | ||
|
|
6ccae0cd33 |
@@ -1,5 +1,9 @@
|
|||||||
# sapper changelog
|
# sapper changelog
|
||||||
|
|
||||||
|
## 0.19.3
|
||||||
|
|
||||||
|
* Better unicode route handling ([#347](https://github.com/sveltejs/sapper/issues/347))
|
||||||
|
|
||||||
## 0.19.2
|
## 0.19.2
|
||||||
|
|
||||||
* Ignore editor tmp files ([#220](https://github.com/sveltejs/sapper/issues/220))
|
* Ignore editor tmp files ([#220](https://github.com/sveltejs/sapper/issues/220))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sapper",
|
"name": "sapper",
|
||||||
"version": "0.19.2",
|
"version": "0.19.3",
|
||||||
"description": "Military-grade apps, engineered by Svelte",
|
"description": "Military-grade apps, engineered by Svelte",
|
||||||
"main": "dist/middleware.js",
|
"main": "dist/middleware.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -185,7 +185,8 @@ function serve({ prefix, pathname, cache_control }: {
|
|||||||
const type = lookup(req.path);
|
const type = lookup(req.path);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = read(req.path.slice(1));
|
const file = decodeURIComponent(req.path.slice(1));
|
||||||
|
const data = read(file);
|
||||||
|
|
||||||
res.setHeader('Content-Type', type);
|
res.setHeader('Content-Type', type);
|
||||||
res.setHeader('Cache-Control', cache_control);
|
res.setHeader('Cache-Control', cache_control);
|
||||||
|
|||||||
@@ -1 +1,11 @@
|
|||||||
<h1>I'm afraid I just blue myself</h1>
|
<h1>{phrase}</h1>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
preload() {
|
||||||
|
return this.fetch('fünke.json').then(r => r.json()).then(phrase => {
|
||||||
|
return { phrase };
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
9
test/app/routes/fünke.json.js
Normal file
9
test/app/routes/fünke.json.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export function get(req, res) {
|
||||||
|
res.writeHead(200, {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
});
|
||||||
|
|
||||||
|
res.end(JSON.stringify(
|
||||||
|
"I'm afraid I just blue myself"
|
||||||
|
));
|
||||||
|
}
|
||||||
@@ -746,7 +746,7 @@ function run({ mode, basepath = '' }) {
|
|||||||
|
|
||||||
it('allows reserved words as route names', () => {
|
it('allows reserved words as route names', () => {
|
||||||
return nightmare.goto(`${base}/const`).init()
|
return nightmare.goto(`${base}/const`).init()
|
||||||
.then(() => nightmare.page.title())
|
.page.title()
|
||||||
.then(title => {
|
.then(title => {
|
||||||
assert.equal(title, 'reserved words are okay as routes');
|
assert.equal(title, 'reserved words are okay as routes');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user