update test

This commit is contained in:
Rich Harris
2018-01-14 18:14:07 -05:00
parent 0c158b9e1f
commit d457af8d51
3 changed files with 21 additions and 24 deletions

View File

@@ -0,0 +1,17 @@
import posts from './_posts.js';
const contents = JSON.stringify(posts.map(post => {
return {
title: post.title,
slug: post.slug
};
}));
export function get(req, res) {
res.set({
'Content-Type': 'application/json',
'Cache-Control': `max-age=${30 * 60 * 1e3}` // cache for 30 minutes
});
res.end(contents);
}