Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkusa/elide-inside
https://github.com/jkusa/elide-inside
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jkusa/elide-inside
- Owner: jkusa
- Created: 2016-12-01T16:49:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-16T05:29:58.000Z (about 2 years ago)
- Last Synced: 2024-10-28T17:13:12.079Z (3 months ago)
- Language: Java
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elide Example
## Usage
1. Install and start a MySQL server
2. Create ```elide``` database
mysql> create database elide;
3. Create ```elide``` user with password ```elide123```
mysql> grant all on elide.* to 'elide'@'localhost' identified by 'elide123';
4. Launch the example webservice
~/elide $ mvn install
~/elide $ cd elide-example/elide-persistence-mysql-example
~/elide/elide-example/elide-persistence-mysql-example $ mvn exec:java -Dexec.mainClass="com.yahoo.elide.example.persistence.Main"5. Create an author
$ curl -H'Content-Type: application/vnd.api+json' -H'Accept: application/vnd.api+json' --data '{
"data": {
"id": "-",
"type": "author",
"attributes": {
"name": "Ernest Hemingway"
}
}
}' -X POST http://localhost:4080/author6. Create a book
$ curl -H'Content-Type: application/vnd.api+json' -H'Accept: application/vnd.api+json' --data '{
"data": {
"id": "-",
"type": "book",
"attributes": {
"title": "The Old Man and the Sea",
"genre": "Literary Fiction",
"language": "English"
}
}
}' -X POST http://localhost:4080/book7. Associate the author and book
$ curl -H'Content-Type: application/vnd.api+json' -H'Accept: application/vnd.api+json' --data '{
"data": {
"id": "1",
"type": "author"
}
}' -X PATCH http://localhost:4080/book/1/relationships/authors8. Get books
$ curl -H'Content-Type: application/vnd.api+json' -H'Accept: application/vnd.api+json' http://localhost:4080/book/
You can also load some pre-configured authors and books using `load_elide.sh` in `src/main/scripts/`