micro-analytics / micro-analytics-cli

Public analytics as a Node.js microservice. No sysadmin experience required! 📈
MIT License
734 stars 39 forks source link

Add support for adapter cli config #62

Closed relekang closed 7 years ago

relekang commented 7 years ago

This adds the possibility to configure adapters through the cli. It will also add the options to the help screen e.g. --db-name for flat-file-adapter 👇

  Usage: micro-analytics [options] [command]

  Commands:

    help  Display help

  Options:

    -a, --adapter [value]  Database adapter used (defaults to "flat-file-db")
    -d, --db-name [value]  The name of the flat-file-db file. (defaults to "views.db")
    -h, --help             Output usage information
    -H, --host [value]     Host to listen on (defaults to "0.0.0.0")
    -p, --port <n>         Port to listen on (defaults to 3000)
    -v, --version          Output the version number

It adds to new parts to adapters:

Todo

mxstbr commented 7 years ago

Sweeeeet, looks great so far!

relekang commented 7 years ago

Added some adapter tests and documentation. This is just wating for shipping https://github.com/micro-analytics/adapter-flat-file-db/pull/7 now 🙂

mxstbr commented 7 years ago

Shipped, let's get this shipped too!

codecov-io commented 7 years ago

Codecov Report

Merging #62 into master will increase coverage by 5%. The diff coverage is 67.44%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #62   +/-   ##
=======================================
+ Coverage   68.04%   73.04%   +5%     
=======================================
  Files           6        6           
  Lines          97      115   +18     
  Branches       20       25    +5     
=======================================
+ Hits           66       84   +18     
- Misses         28       29    +1     
+ Partials        3        2    -1
Impacted Files Coverage Δ
src/index.js 0% <0%> (ø) :arrow_up:
src/db.js 100% <100%> (+22.22%) :arrow_up:
src/parseArgs.js 95.83% <94.44%> (-4.17%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eafa365...530d443. Read the comment docs.