Skip to content

miayam/tokyo-catch-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tokyo Catch API

The boring mock API to redeem weekly rewards.

Table of Contents

Introduction

This boring mock API is built with Express.js. The maintainer of this repo keeps the number of dependencies to a minimum. We only need node-cache to store response in-memory, jest for test suites, and supertest to mock API request.

Requirement

You only need the latest (or decent) version of Node.js installed in your machine. That's it.

Development

Install all dependencies:

$ npm install

After that, run this command:

$ npm run start

Hit localhost:3000 to see the result.

Here's the available endpoints:

  • GET localhost:3000/users/:userId.
  • GET localhost:3000/users/:userId/rewards?at={ISO 8061 date string format}.
  • PATCH localhost:3000/users/:userId/rewards/:rewardId/redeem.

To test them all, run this command:

$ npm run test

Special Thanks