Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freshollie/romegen
A Node.JS server which parses and generates roman numerals
https://github.com/freshollie/romegen
Last synced: 3 days ago
JSON representation
A Node.JS server which parses and generates roman numerals
- Host: GitHub
- URL: https://github.com/freshollie/romegen
- Owner: freshollie
- Created: 2019-01-10T17:15:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-13T18:58:45.000Z (about 6 years ago)
- Last Synced: 2024-11-11T19:43:10.879Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 88.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Romegen
Roman numerals generator and parsing API.
## Goals
As a backend software engineer, I ensure that my code is 100% unit test
covered. This provides maintainability and faster development through TDD.I used ESLint to help with automated code formatting and checking.
## Running
`npm install` to install dependencies
`npm start` to start the serverThe server starts on port 4943
## Interface
The API interface treats numbers and numerals and resources, and
always responds with a JSON.Error responses will always come in the form of `{ error: "message" }`
with a status code sent back in the headers.Method | Path | Response | Description
-------| ----- | -------- | ----------
`GET` | `/numerals/:numeralString` | `{ decimal: number }` | Returns the decimal of the given numeral string. Invalid strings return an error code 422 with an explanation in the message
`GET` | `/decimal/:number` | `{numerals: numeralString }` | Returns the numeral string of the given decimal. Bad numbers return an error code 422 with an explantation## Improvements
The API is currently entirely synchronous. This could be improved by using `flushPromise`
a library which allows control to be handed away during long running loops. However, I'm
not sure this would make much of a difference, a better approach would to scale the application horizontally to cope for demand.## Testing
Testing is completed with `jest` and can be run with `npm test`
## Linting
Airbnb linting rules are used for this project, with eslint
run `npm run lint` to run lint tests