Coder Social home page Coder Social logo

tsegismont / vertx-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infinispan-demos/vertx-api

0.0 2.0 0.0 22 KB

Simple example that creates a REST and PUSH API with Vert.x and Infinispan

Shell 5.91% JavaScript 7.94% HTML 0.80% Java 85.34%

vertx-api's Introduction

This is a simple example on how to build your first Vert.x using Infinispan.

Example include :

  • REST API
  • PUSH API

Running locally

  • Download Infinispan server and unzip it
  • Start Infinispan Standalone Server running ./infinispan-server/bin/standalone.sh

REST API

  • cd resapi
  • run mvn exec:java -Dexec.mainClass="cutenames.CuteNamesRestAPI"

You can now put and get names using curl.

curl -X POST -H "Content-Type: application/json" -d '{"id":"42", "name":"Oihana"}' "http://localhost:8081/api/cutenames"

curl -X GET -H "Content-Type: application/json" "http://localhost:8081/api/cutenames/42"

curl -X POST -H "Content-Type: application/json" -d '{"name":"Elaia"}' "http://localhost:8081/api/cutenames"

Push API

  • cd socketapi
  • run mvn exec:java -Dexec.mainClass="cutenames.SendCuteNamesAPI"

Running the client application

  • cd cute-react
  • run npm install
  • run npm start
  • Go to http://localhost:9000/

Each time a new name will be posted, the name will be displayed in the client application.

Deploying the solution on Openshift

  • Docker version 1.13.1. Above versions are not guaranteed to be fully working on Openshift
  • OpenShift Client 3.6
  • Kubernetes 1.6
  • Kubetail 1.2.1

Docker daemon has to be running !

  • Start Openshift cluster with the service catalog ./bin/start-openshift.sh
  • Start Infinispan cluster ./bin/start-infinispan.sh
  • Deploy the verticles mvn fabric8:deploy

The configuration of the client should be changed to go to the URL of Openshift instead of localhost. TODO: Deploy the client app in Openshift

vertx-api's People

Contributors

karesti avatar tsegismont avatar

Watchers

James Cloos avatar  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.