Skip to content

CharlesInteractive/Md-to-Html-Converter-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Md-to-Html-Converter-Server

A simple Node.js Express server that takes markdown and converts it into html using Markdown-it.

Usage example:

  const ex = "# A first-level heading"

  const getMarkdown = async (md) => {
    const options = {
      method: "POST",
      body: JSON.stringify({
        markdown: md
      }),
      headers: {
        "Content-Type": "application/json"
      }
    }

    try {
      const response = await fetch('http://localhost:8001/convert-markdown', options)
      const result = await response.text()
      console.log(result)
      
    } catch (error) {
      console.error(error)
      alert(error)
    }
  }

  getMarkdown(ex) // logs "<h1>A first-level heading</h1>"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published