Giter Club home page Giter Club logo

carservice's Introduction

CarService

Kā palaist servisu:

main funkcija atrodas src/controllers/RestServer

Ka arī esmu izveidojis jaru iekšā out/artifacts/CarService_jar, kuru var palaist šādi:

java -jar CarService.jar <POSTGRESQL_HOST> <POSTGRESQL_PORT> <POSTGRESQL_USERNAME> <POSTGRESQL_DB> <POSTGRESQL_PASSWORD>

Kā palaist frontend

frontend kods atrodas frontend mapītē, to palaist var ar komandām (secīgi)

npm install

npm run dev

Vienīgā problēma ir tādā ka man nesanācā salabot CORS uz servera, tādēļ browseri kuru izmantojat vajag palaist unsecure mode (piemēram chrome: --disable-web-security)

Routes:

Route Method Query/Form Parameters Description
/employees GET startingFrom, name Atgriež visus darbiniekus
/employees/{id} GET Atgriež pieprasīto darbinieku (pēc ID)
/employees/{id}/cars GET Atgriež savienojumus ar piesaistītajām mašīnām
/employees POST name, surname Pievieno jaunu darbinieku (name, surname)
/cars GET startingFrom, regNumber, manufacturer Atgriež visas mašīnas
/cars/{id} GET Atgriež pieprasīto mašīnu (pēc ID)
/cars POST manufacturer, model, regNumber Izveido jaunu mašīnu (pēc ID)
/employeecars GET startingFrom, employeeId, carId Atgriež visas mašīnu un darbinieku saistības
/employeecars/{id} GET Atgriež specifisko pieprasīto saistību (pēc ID)
/employeecars POST employeeId, carId Izveido jaunu darbinieka un mašīnas saistību
/timeframes GET startingFrom, employeeCarId Atgirēz visus mašīnas izmantošanas laikus
/timeframes/{id} GET Atgriež specifisku mašīnas izmantošanas laiku
/timeframes POST day, timeFrom, timeTo, employeeCarId Izveido jaunu mašīnas izmantošanas laiku

Visi route, atgriež atpakaļ datus JSON formātā, izņemot ja pats jetty serveris izmet ārā koutkādu exception, tad tas ir vienkārši HTML.

carservice's People

Contributors

norbertka avatar

Stargazers

 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.