Creating a CRUD REST API/Service with Spark
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0IDnb2Oy7zcqp3zJvoOueMEaSpPIf4tfWB5lCUFKQtj1Zk0QqUws03McCImyP9h2LOTV1SM1kPqXpR9-CUxWq2XQc-Uiq2cOhD-dljUC57VkAPjjP3TX18HYAYuKJoc3iCOahehUjxz06/w400-h189/spark-real.png)
Hello everyone, today we will discuss how to build RESTful API using Spark. Spark is a micro web framework for Java. Spark aims for simplicity and provides only a minimal set of features. However, it provides everything needed to build a web application in a few lines of Java code. Spark is built around Java 8 Lambda Expression philosophy, making it less verbose than most applications inscribed in other Java frameworks. Routes Let's list the routes that make up our API: GET /employees — get the list of all employees GET /employees/:id — get employees with given id POST /employees/:id — add an employee PUT /employees/:id — edit a particular employee DELETE /employees/:id — delete a particular employees Let's start to build RSETFul API with Spark Maven Dependencies[pom.xml] <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance&