use blog.json instead of blog/list.json

This commit is contained in:
Rich Harris
2018-02-28 16:17:07 -05:00
parent c36780fdc8
commit 58754c6d15
3 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
import posts from './blog/_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);
}