Giter Site home page Giter Site logo

wikitest's Introduction

wikitest

wikipedia wrapper

STEPS TO SETUP

  1. Install NODE 17 + and NPM 8 +
  2. Install redis v7 +
  3. start redis server with redis-server
  4. note the port, default is 6379
  5. Setup .env file with vars, HOSTand PORT, this will be used for Redis your HOST is your localhost like so
HOST='127.0.0.1'
PORT='6379'
SERVER_PORT='3000'
  1. Add var for SERVER_PORT, I used 3000 for my default
  2. Run npm i in root directory, /wikitest/
  3. Run npm start to start server, you should see fastify intiate logging, base urlshould be http://localhost:3000/

ENDPOINTS

For month

URL: /v1/month/:YYYY-MM

For week

URL: /v1/month/:YYYY-MM-DD

Both endpoints should return the following JSON

    [
        {"articleName": string, "views": int, "most": int, "date": string },
        ...
    ]

articleName will be a string value that is the name of the article
view is an int value that is the total view for the week/month
most is an int value that is the highest day of views for a given week/month
date is a date formatted string that indicates the day for a given article that had the highest views

TEST

testing uses tap and is built into npm
simply run npm test in the root dir

wikitest's People

Contributors

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