kasra-sh/MikroServer


Fast, Easy, Lightweight and Embeddable Java Web Server supporting Quasar Fibers.

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.kasra-sh:mikroserver:2.20'
	}
	dependencies {
		implementation("com.github.kasra-sh:mikroserver:2.20")
	}
	<dependency>
	    <groupId>com.github.kasra-sh</groupId>
	    <artifactId>mikroserver</artifactId>
	    <version>2.20</version>
	</dependency>

                            
    libraryDependencies += "com.github.kasra-sh" % "mikroserver" % "2.20"
        
        

                            
    :dependencies [[com.github.kasra-sh/mikroserver "2.20"]]
        
        

Readme


MikroServer

Version 2.0 (beta)

MikroServer is a lightweight embeddable java web server, using Quasar Fibers with high concurrency and low overhead.

1. Features

  • Fast File Server with Cache Support
  • Full HTTP 1.1 Support(GET/POST)
  • Reverse Proxy
  • JSON Suppport with Gson Library

2. How to build

In order to build and run, first clone project :

 $ git clone https://gitlab.com/kasra.sh13/mikroserver.git

Then use gradle to build/run :

Build :
$ ./gradlew build

3. How to Run

You can run it using gradle :

Run :
$ ./gradlew run

4. Make Jar

You can also make a jar file with all dependencies, however in order to run the jar you have to set -javaagent to the path of quasar-core.jar file.

$ ./gradlew fatJar
Run Jar
$ java -javaagent:/home/blkr/quasar-core-0.7.9.jar -jar path/to/file.jar

You can also disable Quasar warnings by adding another parameter after -javaagent :

... -Dco.paralleluniverse.fibers.detectRunawayFibers=false ...