Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.6 KB

README.md

File metadata and controls

63 lines (40 loc) · 1.6 KB

Markdown Parser HTTP Server

This is a simple HTTP server written in Rust that accepts Markdown content via POST requests and returns the corresponding HTML. It uses the warp web framework for handling HTTP requests and pulldown-cmark for parsing Markdown.

Features

  • Accepts Markdown content via HTTP POST requests.
  • Converts Markdown to HTML.
  • Returns the HTML as the response.

Prerequisites

Setup

  1. Clone the repository:

    git clone https://github.com/darshansrc/markdown-parser-rust.git
    cd markdown-parser-rust
  2. Build the project:

    cargo build
  3. Run the server:

    cargo run

    The server will start on localhost:3030.

Usage

You can test the server using curl or any HTTP client by sending a POST request with Markdown content.

Example using curl:

curl -X POST -d '# Hello World' http://localhost:3030

This will return:

<h1>Hello World</h1>

Dependencies

  • warp - A super-easy, composable, web server framework for warp speeds.
  • tokio - An asynchronous runtime for the Rust programming language.
  • pulldown-cmark - A library for parsing Markdown.
  • bytes - Utilities for working with bytes.

License

This project is licensed under the MIT License. See the LICENSE file for details.