Justifier is a REST API that justifies text. Check out the documentation for more information.
- Clone the repo.
git clone https://github.com/3kezoh/justifier.git justifier
- Change directory.
cd justifier
- Install NPM packages.
npm install
- Add environment variables in a .env file.
JWT_SECRET=
JWT_EXPIRATION=
MONGODB_URI=
MONGODB_URI_LOCAL=
MONGODB_URI_TEST=
NODE_ENV=
PORT=
- Compile Typescript.
npm run build
# or
npm run build:watch
- Start the development server.
npm run dev
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
You can send HTTP request at the live demo deployed on heroku.
https://ekezoh-justifier.herokuapp.com
- 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]" }'
- 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."