vaske / sample

sample spark angularjs app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample AngularJS Spark application for testing purpose

sample spark angularjs app

Installation

Install Git, node.js, JDK 8, and Maven 3.

Compile the service:

mvn compile

Run the service:

mvn exec:exec

Your service will run at http://localhost:8080.

A client-side AngularJS application will now be available by running

grunt server

The Grunt server will run at http://localhost:9000. It will proxy REST requests to the Spark service running at http://localhost:8080.

API Endpoints

Get list of all companies [GET]

sample/companies

CURL example:

curl -X GET "http://localhost:8080/sample/companies"

Get details about company [GET]

sample/companies/:id

CURL example:

curl -X GET "http://localhost:8080/sample/companies/:id"

Create new Company [POST]

sample/companies

CURL example:

curl -XPOST "http://localhost:8080/sample/companies" --data '{"company_id": "1", "name": "Sample Name", "address": "sample address", "city": "sample city", "country": "sample country", "no_employees": "1"}'

Update company [PUT]

sample/companies/:id

CURL example:

curl -XPUT "http://localhost:8080/sample/companies/:id" --data '{"id":":id", "company_id": "1", "name": "Sample Name", "address": "sample address", "city": "sample city", "country": "sample country", "no_employees": "1"}'

Delete company [DELETE]

sample/companies/:id

CURL example:

curl -X DELETE "http://localhost:8080/sample/companies/:id"

Add company owner [POST]

sample/company_owners

CURL example:

curl -XPOST "http://localhost:8080/sample/company_owners" --data '{"company_id": "1", "owner_name": "Sample Name"}'

About

sample spark angularjs app


Languages

Language:JavaScript 57.2%Language:CSS 40.6%Language:HTML 1.2%Language:Java 1.0%