Giter VIP home page Giter VIP logo

flashcards's Introduction

Flashcards

Setup and run:

  • Clone repository
  • npm install
  • Create .env file.
  • npm run dev

Frontend clients:

Sample calls

SERVER=http://127.0.0.1:3001 # start local server with: npm run dev
TOKEN="xxx" # get this with login, see below
AUTH="Authorization: Bearer $TOKEN"

# controllers/User.js

# login
curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"username":"may", "password":"12345"}' \
  $SERVER/user/login | jq

# signup
curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"username":"may", "password":"12345"}' \
  $SERVER/user/signup | jq

# controllers/Card.js

# Get cards (of auth user)
curl -s \
  -H "Content-Type: application/json" \
  -H "$AUTH" \
  $SERVER/cards | jq

# Add card (for auth user)
curl -X POST \
  -H "Content-Type: application/json" \
  -H "$AUTH" \
  -d '{"front":"日本語", "back":"Japanese", "tags":["sample"], "tts":true}' \
  $SERVER/cards

# Generate test card for audio listening
curl -X POST \
  -H "Content-Type: application/json" \
  -H "$AUTH" \
  -d '{"front":"日本語"}' \
  $SERVER/cards/tts

# controllers/Todo.js (model from the original example)

curl \
  -H "Content-Type: application/json" \
  -H "$AUTH" \
  $SERVER/todos

flashcards's People

Contributors

alexmercedcoder avatar

Watchers

Ferran Maylinch 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.