https://github.com/msimonin/restletapplication
Archetype source for a RESTlet application sample
https://github.com/msimonin/restletapplication
Last synced: 3 months ago
JSON representation
Archetype source for a RESTlet application sample
- Host: GitHub
- URL: https://github.com/msimonin/restletapplication
- Owner: msimonin
- License: gpl-2.0
- Created: 2014-01-15T17:05:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-18T21:32:47.000Z (over 10 years ago)
- Last Synced: 2025-01-12T18:38:11.639Z (5 months ago)
- Language: Java
- Size: 403 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
RESTlet Sample Application
==========================This is an archetype with an application skeleton to demonstrate the use of the [RESTlet framework](http://restlet.org).
It exposes a simple Restful API compatible with [Restfully](https://github.com/crohr/restfully).Versions :
For specific versions, checkout the corresponding tag.
* 0.0.1 : "Hello world" application
* current :The application present a "grid like" resource. A grid is composed of clusters of machines.# Running from the sources
Clone the repository
```
git clone https://github.com/msimonin/RestletApplication
cd RestletApplication
```
compile it```
./compile.sh
```Go to the target directory and launch :
```
java -jar uber[...] ../configs/application.cfg ../configs/log4j.xml
```Test it :
* root resources : ```curl localhost:4001/1.0```
* clusters resources: ```curl localhost:4001/1.0/clusters```
* add cluster with a ```POST``` request, remove one with a ```DELETE``` ...or use Restfully :
```
>> pp root
#
=> nil
>> pp root.clusters
#
#>
=> nil
>> pp root.clusters[:cluster1]
#"cluster1">
=> nil
>> pp root.clusters[:cluster1].delete
#
=> nil
>> pp root.clusters.submit("test")
#"test"
"message"=>nil>
=> nil
>> pp root.clusters
#
#>
=> nil```
# Getting the archetype
Alternatively, if you want to integrates this to your work you can download the archetype skeleton.
```
mvn archetype:generate -DarchetypeCatalog=http://snooze.inria.fr/maven
```## Compiling
Move to the root directory, you should see :
```
.
├── compile.sh
├── configs
├── LICENSE
├── pom.xml
├── README.md
├── src
└── target
```and run
```
mvn package
```