Skip to content

landschootl/api-blog-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

api-blog-markdown

Build Status

API that provides blog posts generated by mardown files 🌐

Run the server πŸ”Œ

  • 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/"

Write an post in the blog πŸ“

  • 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 !

Recover posts πŸ“€

  • 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 post
    • curl 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