GithubHelp home page GithubHelp logo

justifier's Introduction

Justifier

Justifier is a REST API that justifies text. Check out the documentation for more information.

Prerequisites

Installation

  1. Clone the repo.
git clone https://github.com/3kezoh/justifier.git justifier
  1. Change directory.
cd justifier
  1. Install NPM packages.
npm install
  1. Add environment variables in a .env file.
JWT_SECRET=
JWT_EXPIRATION=
MONGODB_URI=
MONGODB_URI_LOCAL=
MONGODB_URI_TEST=
NODE_ENV=
PORT=
  1. Compile Typescript.
npm run build
# or
npm run build:watch
  1. Start the development server.
npm run dev

Usage

You may want to use Postman or the curl CLI to consume the api.

NOTE There is a rate limit of 80.000 words per/day

Example

You can send HTTP request at the live demo deployed on heroku.

https://ekezoh-justifier.herokuapp.com

  1. Get an access token at /auth/token with an email.
curl --request POST https://justifier-3kezoh.herokuapp.com/auth/token \
--header "Content-Type: application/json" \
--data '{ "email": "[email protected]" }'
  1. Justify some text at /api/justify
curl --request POST https://justifier-3kezoh.herokuapp.com/api/justify \
--header "Authorization: Bearer <accessToken>" \
--header "Content-Type: text/plain" \
--data "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean in libero sed sem pulvinar aliquam vitae et quam. Sed in lorem sed neque viverra rutrum. Aenean vitae ultrices diam. Nullam suscipit tincidunt urna. Vestibulum eget fermentum mauris. Duis vel velit volutpat, sodales purus tempor, sodales mi."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.