initial commit

This commit is contained in:
Rich Harris
2018-08-25 13:03:34 -04:00
commit a69b70e745
34 changed files with 936 additions and 0 deletions

16
routes/blog/index.json.js Normal file
View File

@@ -0,0 +1,16 @@
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.writeHead(200, {
'Content-Type': 'application/json'
});
res.end(contents);
}