Git Product home page Git Product logo

mongoosecpp's Introduction

Build Status Build status Codacy Badge

MongooseCpp

Mongoose c++ embeded web server cross-platform.

Introduction

Embedded web server write in c++ and based on Mongoose. Build on Travis and Appveyor factories. A good solution to add an user interface for your programs.

Features

  • Web server with controller and configurable route.
  • Page controller to display statics pages.
  • Api controller to manage GET, POST, PUT and DELETE methods.
  • Type controler to manage a web api with an object.
  • Interface to create any controllers.

How to use

Add src and dependency/mongoose folders into your project and see examples folder.

To build, add define MG_ENABLE_CALLBACK_USERDATA. You can see CMakeLists.txt, Code::Blocks or MSVC projects in builds folder.

For example :

	int main()
	{
		WebServer myServer;
		HelloController helloController;
		PageController pageController("./", true);
		JsonController jsonController;
		MultiController multiController;

		myServer.AddRoute("/hello", &helloController);
		myServer.AddRoute("/examples/*", &pageController);
		myServer.AddRoute("/api/v1/books/[Id]", &jsonController);
		myServer.AddRoute("/multi/{controller}/[Id]", &multiController);

		myServer.Start();
		while(true)
		{
			myServer.Poll();
		}
		myServer.Stop();
		return 0;
	}

Licence

MongooseCpp is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

MongooseCpp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with MongooseCpp. If not, see http://www.gnu.org/licenses/.

mongoosecpp's People

Contributors

fragjage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mongoosecpp's Issues

how to stop listening

mg_connection* mg_con = mg_http_listen(&mgr, 10000 , fn, NULL); // Create HTTP listener

hey guys,I want to stop the mg_con listen on port 10000, I don't know how to, could you please give me some help , thank you.

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.