Giter Site home page Giter Site logo

sshyran / vin-decoder-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adaptant-labs/vin-decoder-service

0.0 1.0 0.0 19 KB

A simple VIN decoding microservice wrapped around the vin_decoder package written in Dart.

License: Apache License 2.0

Dart 96.00% Dockerfile 4.00%

vin-decoder-service's Introduction

vin-decoder-service

Build Status

A simple VIN decoding microservice wrapped around the vin_decoder package written in Dart.

Installation

The application can be activated from pub directly:

$ pub global activate --source path <path to repository>
Package vin_decoder_service is currently active at path "...".
Installed executable vindecoder-service.
Activated vin_decoder_service 0.0.4 at path "...".

Usage

The vindecoder-service can run standalone, or can register itself with a Consul Agent to ease with service discovery. By default, an attempt to register with Consul will be made.

To run standalone on the server side and inhibit Consul registration, the --no-use-consul flag may be specified:

$ vindecoder-service --no-use-consul
VIN Decoder Service Registered on 0.0.0.0:8080/vin
...

otherwise, the default behaviour applies, and service registration will be attempted with the defined (or default) agent:

$ vindecoder-service
Registering VIN Decoder Service with Consul Agent @ localhost:8500
VIN Decoder Service Registered on 0.0.0.0:8080/vin
...

An overview of supported commands and flags is provided below:

$ vindecoder-service --help
usage: vindecoder-service [-pcu]

-p, --port               Port to bind to
                         (defaults to "8080")

-c, --consul-agent       Consul Agent to register service with
                         (defaults to "localhost:8500")

-u, --[no-]use-consul    Use Consul for service registration
                         (defaults to on)

-h, --help               Show usage info

From the client side, decoding may be tested by sending a JSON-encoded VIN string:

$ curl -X POST -H "Content-Type: application/json" -d '{ "vin": "WP0ZZZ99ZTS392124" }' http://localhost:8080/vin

with the decoded VIN returned in the POST response body:

{"wmi":"WP0","vds":"ZZZ99Z","vis":"TS392124","year":"1996","region":"EU","manufacturer":"Porsche","assembly_plant":"S","serial_number":"92124","make":"Porsche","model":"911","vehicle_type":"Passenger Car"}

Health Checking

A /health endpoint is provided and registered with Consul by default - in practice, this simply checks continued connectivity to the Consul Agent from the service side. In the cases where Consul isn't used, it simply denotes the continued accessibility of the service itself.

Prometheus Metrics

Prometheus metrics are also provided and can be scraped from the /metrics endpoint as expected.

Deployment

Docker images are provided under adaptant/vin-decoder-service and can be run without any special configuration:

$ docker run -d -p 8080:8080 adaptant/vin-decoder-service

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Licensed under the terms of the Apache 2.0 license, the full version of which can be found in the LICENSE file included in the distribution.

vin-decoder-service's People

Contributors

pmundt 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.