Code Monkey home page Code Monkey logo

datingapp-backend's Introduction

Requirements

  • Node 5.7
  • MongoDB 3.x

MongoDB Indices

db.accounts.createIndex({ 'username': 1 }, { unique: true });

CURL Samples

Create Account

curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "boy1", "password": "abc123", "gender": "male", "age": 23, "preference": { "distance": 1000, "gender": "female", "age_range": { "from": 18, "to": 35 } } }'
curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "girl1", "password": "abc123", "gender": "female", "age": 24, "preference": { "distance": 1000, "gender": "male", "age_range": { "from": 18, "to": 35 } } }'
curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "girl2", "password": "abc123", "gender": "female", "age": 16, "preference": { "distance": 1000, "gender": "male", "age_range": { "from": 18, "to": 35 } } }'
curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "girl3", "password": "abc123", "gender": "female", "age": 26, "preference": { "distance": 1000, "gender": "male", "age_range": { "from": 18, "to": 35 } } }'
curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "girl4", "password": "abc123", "gender": "female", "age": 28, "preference": { "distance": 1000, "gender": "male", "age_range": { "from": 18, "to": 35 } } }'
curl -i -X POST 'http://localhost:8080/accounts' -H 'Content-Type: application/json' -d '{ "username": "girl5", "password": "abc123", "gender": "female", "age": 17, "preference": { "distance": 1000, "gender": "male", "age_range": { "from": 18, "to": 35 } } }'

Login

curl -i -X POST 'http://localhost:8080/accounts/auth' -H 'Content-Type: application/json' -d '{ "username": "boy1", "password": "abc123" }'

Suggest People

curl -i -X GET 'http://localhost:8080/users/:id/suggestions' -H 'Content-Type: application/json' -H 'Authorization: TOKEN token=<auth_token>'

Like

curl -i -X PUT 'http://localhost:8080/users/:id/likes/:target_uid' -H 'Content-Type: application/json' -H 'Authorization: TOKEN token=<auth_token>'

datingapp-backend's People

Contributors

liangdev avatar

Stargazers

 avatar  avatar

Watchers

 avatar

datingapp-backend's Issues

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.