Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shivam-880/play-slick-scala
Restful webservices in Scala using Play framework and Slick
https://github.com/shivam-880/play-slick-scala
play scala slick
Last synced: 7 days ago
JSON representation
Restful webservices in Scala using Play framework and Slick
- Host: GitHub
- URL: https://github.com/shivam-880/play-slick-scala
- Owner: shivam-880
- License: mit
- Created: 2016-12-17T16:16:19.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T10:10:47.000Z (about 5 years ago)
- Last Synced: 2024-10-09T10:03:09.539Z (28 days ago)
- Topics: play, scala, slick
- Language: Scala
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Play Slick Scala
Restful webservices in Scala using Play framework and Slick## Setup Database
```
CREATE DATABASE slick;
USE slick;CREATE TABLE `USER` (
`ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`FIRST_NAME` TEXT NOT NULL,
`LAST_NAME` TEXT NOT NULL,
`MOBILE` BIGINT NOT NULL,
`EMAIL` TEXT NOT NULL
);CREATE TABLE `ADDRESS` (
`ID` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`CITY` TEXT NOT NULL,
`STATE` TEXT NOT NULL,
`ZIP` BIGINT NOT NULL,
`USER_ID` BIGINT NOT NULL,
FOREIGN KEY (USER_ID) REFERENCES USER(ID)
);
```## Start Service
```
sbt eclipse;
sbt clean compile run;
```## Create User
```
curl -X POST \
http://localhost:9000/users \
-H 'content-type: application/json' \
-d '{
"firstName": "Shivam",
"lastName": "Kapoor",
"mobile": 9965836577,
"email": "[email protected]"
}'
```