Git Product home page Git Product logo

tinyeasyserver's Introduction

TinyEasyServer是一个非常简单的Java嵌入Web Server,最早用于我开发的搜索服务,作为前端。这个Server的目的是实现一个简单好用的多语言间的进程间通讯工具。

简单的例子:

public class MyServer {

	public static void main(String[] args) throws IOException {


		TinyEasyServer server = new TinyEasyServer();
		SmartServerConfig config = new SmartServerConfig();
		server.start(config);
	}
}

class SmartServerConfig extends ServerConfig {

	@Override
	public HttpHandleCls generateHttpHandleCls(String tagFile) {

		if (tagFile.equals("/")) {

			return new BaseHHC();
		}
		return new BaseHHC();
	}
}

class BaseHHC implements HttpHandleCls {

	HttpProtocolCls m_hpc;

	@Override
	public void setHPC(HttpProtocolCls hpc) {

		m_hpc = hpc;
	}

	@Override
	public void response() {

		m_hpc.httpResponse(200, "text/html", "server ok");
	}
}

tinyeasyserver's People

Contributors

tinyfool avatar lidaobing avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.