22 Star 31 Fork 4

zhouxiang / ccfast

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

ccfast

这是一个基于FastCGI和C++的RESTful API开发框架。其依赖于fastcgi,boost,libmysqlpp,jsoncpp,其中用了C++11的特性。现已初步添加了基于Redis的Session支持。

前端web服务器我们使用Nginx,需要的配置如下:

	location ~* ^/ccfast/.+\.do$ {
		fastcgi_pass    127.0.0.1:10000;
    	include         fastcgi.conf;
    }

ccfast 和main.cpp中的 set_project的值一样,如下:

   UrlRoute* _p = UrlRoute::instance();
   _p->set_project("/ccfast");

urlfunction.h 添加一个url对应的function,在 urlfunction.cpp 中实现,在 main.cpp 中注册这个url和方法。如下:

   _p->register_url("/love.do", love);

启动nginx,在浏览器中,输入http://localhost/ccfast/love.do?boy=zhou&girl=chen,结果如下图:

基于这个框架,我们可以快速地开发效率很高的API服务。详细请看 love 的例子。 请设置好你自己的mysql_redis.conf,不然不能正确运行。

###INSTALL 使用ccfast_install进行安装,我们使用 spawn-fcgi 来进行fcgi进程的启动,命令如下:spawn-fcgi -a 127.0.0.1 -p 10000 -f /usr/local/ccfast/ccfast

Empty file

About

a cpp fastcgi framework for developping resuful api expand collapse
C++
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
C++
1
https://gitee.com/zhouX/ccfast.git
git@gitee.com:zhouX/ccfast.git
zhouX
ccfast
ccfast
master

Search