Skip to content

Commit ffc07e0

Browse files
committedApr 10, 2016
initial commit
0 parents  commit ffc07e0

File tree

6 files changed

+185
-0
lines changed

6 files changed

+185
-0
lines changed
 

‎.gitignore

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Java template
3+
*.class
4+
5+
# Mobile Tools for Java (J2ME)
6+
.mtj.tmp/
7+
8+
# Package Files #
9+
*.jar
10+
*.war
11+
*.ear
12+
13+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
14+
hs_err_pid*
15+
### JetBrains template
16+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
17+
18+
*.iml
19+
20+
## Directory-based project format:
21+
.idea/
22+
# if you remove the above rule, at least ignore the following:
23+
24+
# User-specific stuff:
25+
# .idea/workspace.xml
26+
# .idea/tasks.xml
27+
# .idea/dictionaries
28+
29+
# Sensitive or high-churn files:
30+
# .idea/dataSources.ids
31+
# .idea/dataSources.xml
32+
# .idea/sqlDataSources.xml
33+
# .idea/dynamic.xml
34+
# .idea/uiDesigner.xml
35+
36+
# Gradle:
37+
# .idea/gradle.xml
38+
# .idea/libraries
39+
40+
# Mongo Explorer plugin:
41+
# .idea/mongoSettings.xml
42+
43+
## File-based project format:
44+
*.ipr
45+
*.iws
46+
47+
## Plugin-specific files:
48+
49+
# IntelliJ
50+
/out/
51+
52+
# mpeltonen/sbt-idea plugin
53+
.idea_modules/
54+
55+
# JIRA plugin
56+
atlassian-ide-plugin.xml
57+
58+
# Crashlytics plugin (for Android Studio and IntelliJ)
59+
com_crashlytics_export_strings.xml
60+
crashlytics.properties
61+
crashlytics-build.properties
62+
### Gradle template
63+
.gradle
64+
build/
65+
66+
# Ignore Gradle GUI config
67+
gradle-app.setting
68+
69+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
70+
!gradle-wrapper.jar
71+

‎build.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
group 'Greplr'
2+
version '0.1.0-SNAPSHOT'
3+
4+
buildscript {
5+
repositories {
6+
jcenter()
7+
}
8+
dependencies {
9+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.1"
10+
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
11+
}
12+
}
13+
14+
apply plugin: 'java'
15+
apply plugin: 'kotlin'
16+
apply plugin: 'application'
17+
18+
sourceCompatibility = 1.7
19+
20+
mainClassName = 'com.greplr.server.GreplrServer'
21+
22+
repositories {
23+
mavenCentral()
24+
}
25+
26+
dependencies {
27+
compile "org.jetbrains.kotlin:kotlin-stdlib:1.0.1"
28+
compile 'io.undertow:undertow-core:1.+'
29+
compile 'io.undertow:undertow-servlet:1+'
30+
compile 'org.jboss.resteasy:resteasy-undertow:3+'
31+
32+
testCompile group: 'junit', name: 'junit', version: '4.11'
33+
}
34+
35+
task fatJar(type: Jar) {
36+
baseName = project.name + '-all'
37+
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
38+
with jar
39+
manifest {
40+
attributes 'Implementation-Title': 'Gradle Quickstart', 'Implementation-Version': version
41+
attributes 'Main-Class': mainClassName
42+
}
43+
}
44+

‎settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = 'Server'
2+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.greplr.server;
2+
3+
import com.greplr.server.endpoints.CabEndpoint;
4+
5+
import javax.ws.rs.ApplicationPath;
6+
import javax.ws.rs.core.Application;
7+
import java.util.HashSet;
8+
import java.util.Set;
9+
10+
/**
11+
* Created by championswimmer on 11/4/16.
12+
*/
13+
@ApplicationPath("/api/v1")
14+
public class GreplrJaxrsApp extends Application {
15+
16+
@Override
17+
public Set<Class<?>> getClasses() {
18+
Set<Class<?>> endpoints = new HashSet<>();
19+
20+
endpoints.add(CabEndpoint.class);
21+
22+
return endpoints;
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.greplr.server;
2+
3+
import io.undertow.Undertow;
4+
import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer;
5+
6+
/**
7+
* Created by championswimmer on 11/4/16.
8+
*/
9+
public class GreplrServer {
10+
11+
public static void main(String[] args) {
12+
UndertowJaxrsServer jt = new UndertowJaxrsServer();
13+
GreplrJaxrsApp ga = new GreplrJaxrsApp();
14+
15+
jt.deploy(ga);
16+
17+
jt.start(
18+
Undertow.builder()
19+
.addHttpListener(8080, "localhost")
20+
);
21+
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.greplr.server.endpoints;
2+
3+
import org.jboss.resteasy.logging.Logger;
4+
5+
import javax.ws.rs.GET;
6+
import javax.ws.rs.Path;
7+
import javax.ws.rs.core.Response;
8+
9+
/**
10+
* Created by championswimmer on 11/4/16.
11+
*/
12+
@Path("/cabs")
13+
public class CabEndpoint {
14+
private static final Logger logger = Logger.getLogger(CabEndpoint.class);
15+
16+
@GET
17+
public Response getStatus() {
18+
19+
return Response.status(Response.Status.OK).entity("JO").build();
20+
}
21+
}

0 commit comments

Comments
 (0)
Please sign in to comment.