Git Product home page Git Product logo

fn-recommend's Introduction

fn-recommend

Fn Project demo in Java implements a recommendation engine mock.

Use case

You can get travel recommendation for a particular traveller based on age, destination and month of travelling.

Implementation

  • uses Jackson marshalling for JSON parameter (Traveller.java)
  • can be deployed on remote Fn as shown here on munz & more blog

Test Data

Test data is provided in ./testdata

e.g. use the following command to call the recommendation engine:

curl -X POST --data @testdata/syd.json localhost:8080/r/advtravel/recommend

Recommended Demo

Preparation

remote

fn apps d advtravel
fn start

local

docker login DOCKER_ID  
export FN_REGISTRY=DOCKER_ID  
export FN_API_URL=http://microservices.click:8080
fn deploy --app advtravel  

Live Demo Local Side

show local app (or deploy first)


fn apps list
[fn deploy --app advtravel --local]
fn apps l

show route

fn routes list advtravel

show logic and data

cd src/main/java/com/munzandmore/fn/
grep handle *.java
cat Traveller.java

test with curl or Postman

curl -X POST --data @testdata/xyz.json localhost:8080/r/advtravel/recommend

Live Demo Remote Side

fn apps c advtravel 
fn routes l advtravel
fn routes c advtravel /fn-recommend recommend:0.0.31

Then test from local curl

curl -X POST --data @testdata/xyz.json REMOTE_IP:8080/r/advtravel/recommend

Should work!

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.