API that provides blog posts generated by mardown files π
- Clone the project
git clone [email protected]:landschootl/api-blog-markdown.git
- Go in the project
cd api-blog-markdown
- Install the dependencies
npm install
- Run the server
node server/server.js
- Open a browser and go to "http://localhost:3000/"
- Create a folder in /posts
- Create a file named index.md in this folder
- Then, copy this content in this file :
---
title: my first post
date: "2018-03-20T15:14:32.169Z"
author: your name
---
Your content
- Feel free to add some images, medias (see our articles already present)...
- And make your Pull Request !
- Run the server (see the section above)
- Open a browser and go to "http://localhost:3000/posts" or open terminal and run
curl localhost:3000/posts
to get all postcurl localhost:3000/posts/:id
to get one post
The schema of a post :
{
id: '',
title: '',
path: '',
date: '',
author: '',
markdown: ''
}
Url for test : https://api-blog-markdown.herokuapp.com/posts