awwit/httpserver

Start problem

wuyougongzi opened this issue · 5 comments

After I compiled success. I try to run server. But I start server failed.
first, I use " ./build/httpserver --start " command to start.
It failed. and tips "Error: file main.conf cannot be open"
Second, I use "./build/httpserver --start --config-path=/home/chongge/httpserver/samples/" , I think --config-path represents the main.conf path dir.
but it faile again and tips "/media/projects/sites/servertest/module/httpserverapp-release.so: cannot open shared object file: No such file or directory
Error: module '/media/projects/sites/servertest/module/httpserverapp-release.so' cannot be open;
Notice: server does not contain applications;
Error: any socket was not open;"

I try to find the httpserverapp file. Is the httpserverapp.so your another project? why starting httpserver have to depent httpserverapp.so? And how can I start httpserver simple?
I have learned the web page develop. So I could create web page to test the httpserver.
I hope to you can teach me the httpserver.

thank you for your help!

awwit commented

Hi!

You need to build an application project: https://github.com/awwit/httpserverapp
And specify in the config path to it.

My server is intended only for developing applications in C++ (as shared library). In the description of the project this is indicated =)

Hi
I start httpserver success, I have viewed the code, I feel your code style is cool.
but I do not understand why you don't use c++ object-oriented code stye.
Such as class members use "m_xxx".
Also you can list something todo in this project. I will try my best to follow you to complete this project.

awwit commented

Hi!

The main interface of the library should be in the style of C, so that the data transfer is as simple as possible.
httpserverapp is just an example application. It can only transfer static files to the client.

The src/application folder should contain the main application code. In other directories there are the main classes for building the application architecture.

The example itself does not contain any application architecture. But I have a working project with a ready architecture. It has additional dependencies such as mysql.

I'm still going to publish the mini-framework, but so far there is no time for this.
Should this be exactly what you need?

No, I only use it for learning, I look for a good project for learning program kills.
So if you have some unimportant things need to do, I may give my hand to you if you don't mind. Just only for learning and interesting.
Thank you!

awwit commented

I understood you.

There is a code in the project, which I have long wanted to refactor:

bool ConfigParser::parseMimes(const std::string &fileName, std::unordered_map<std::string, std::string> &mimes_types)

I want to rebuild the parsing of the config file so it works like a state machine. For example:

bool MultipartFormData::parse(const std::string &buf, Transfer::request_data *rd, DataReceiver *dr) const

Start better with mimes.conf

I hope this will not be very difficult for you!