mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 04:14:46 +00:00
overhaul tests
This commit is contained in:
22
test/apps/store/src/server.js
Normal file
22
test/apps/store/src/server.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import polka from 'polka';
|
||||
import { Store } from 'svelte/store.js';
|
||||
import * as sapper from '../__sapper__/server.js';
|
||||
|
||||
const { PORT } = process.env;
|
||||
|
||||
polka()
|
||||
.use((req, res, next) => {
|
||||
req.hello = 'hello';
|
||||
res.locals = { name: 'world' };
|
||||
next();
|
||||
})
|
||||
.use(
|
||||
sapper.middleware({
|
||||
store: (req, res) => {
|
||||
return new Store({
|
||||
title: `${req.hello} ${res.locals.name}`
|
||||
});
|
||||
}
|
||||
})
|
||||
)
|
||||
.listen(PORT);
|
||||
Reference in New Issue
Block a user