- Java 1.8
- Gradle 4.3
The server was programmed in Java and can be run using applications built to server specifications. See Using your own Application for more information.
Get the code from GitHub:
git clone git@github.com:saralein/java-server.git
Change your directory to cobspec:
cd java-server/cobspec
- For default parameters,
gradle -q run
.- Server will run on port 5000.
- Server will serve from the
public
folder in cobspec.
- To specify parameters, you may provide one or both of the following options:
- To specify a port, you many use the
-p,port
option, whereport
is replaced with a number between 1 and 65535.- Example:
gradle -q run -PrunArgs=-p,6066
.
- Example:
- To specify a directory, you many use the
-d,directory
option, wheredirectory
is replaced by the directory you wish to serve. *Example:gradle -q run -PrunArgs=-d,my-dir
. - Example with both options:
gradle -q run -PrunArgs=-p,6066,-d,my-dir
.
- To specify a port, you many use the
- First build the JAR with
gradle build
. - For default parameters, run the JAR with
java -jar build/libs/cobspec-1.0-SNAPSHOT.jar
.- Server will run on port 5000.
- Server will serve from the
public
folder in cobspec.
- To specify parameters, you may provide one or both of the following options:
- To specify a port, you may use the
-p port
option, whereport
is replaced with a number between 1 and 65535.- Example:
java -jar build/libs/cobspec-1.0-SNAPSHOT.jar -p 5000
.
- Example:
- To specify a directory, you may use the
-d directory
option, wheredirectory
is replaced by the directory you wish to serve relative to your home directory.- Example:
java -jar build/libs/cobspec-1.0-SNAPSHOT.jar -d my-dir
.
- Example:
- Example with both options:
java -jar build/libs/cobspec-1.0-SNAPSHOT.jar -p 5000 -d my-dir
.
- To specify a port, you may use the
For either run method, type ctrl + c
.