Giter Site home page Giter Site logo

kwegonian's Introduction

Kwegonian Translator

Node.js Server and Vue.js client for kwegonian number conversion. For a live preview, try this link.

Running locally

You must have Node.js installed in your environment. Then, run in a shell:

npm run start

There are tests covering the translation core. You can run then with:

npm run test

The Kwegonian Translator will be running in localhost:9000. If you want to override the default port, create a file named ".env" in the root folder, containing:

PORT=DESIRED_PORT

Deploying with docker

Included in the source is a docker-compose, for easy deploying the app. This docker-compose is the same that runs the currently deployed sample. To correctly doing so, this traefik image is necessary to routes subdomains and add SSL certificates.

Structure

  src
  ├── kwego-dictionary  # json containing translations to roman and decimal
  ├── server            # express configuration, routes and web listener
  └── translator        # core translation module

  test
  └── translator        # test coverage for translator module

Usage

To translate using the API, you can either access it thru the browser or via curl:

curl "http://localhost:9000/kwego?k=KWEGOALGARISMS"

where KWEGOALGARISMS are a set of kwegonian algarisms separated by spaces (encoded as %20) or commas. For example:

$ curl "http://localhost:9000/kwego?k=kil,pol"
{"kwego":"kil pol","roman":"IX","decimal":9}

$ curl "http://localhost:9988/kwego?k=pol%20kil%20kil"
{"kwego":"pol kil kil","roman":"XII","decimal":12}

If you want only the decimals to be returned, just pass the parameter dec = 1

$ curl "http://localhost:9900/kwego?k=pol%20jin%20kil&dec=1"
16

kwegonian's People

Contributors

ploissken avatar

Watchers

 avatar

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.