ipkn / crow

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)
BSD 3-Clause "New" or "Revised" License
7.48k stars 891 forks source link

Handling database connection and operation in crow #239

Closed bnlambert closed 7 years ago

bnlambert commented 7 years ago

Crow is a great project. I wish to know how database connection and operations are in Crow apps. Is it done asynchronously or using an ORM? I need recommendations and examples.

Also I will to know if there are tools to document REST APIs in Crow. How can we communicate with third party API in Crow app.

The section on middleware is still blank, How can we secure REST APIs in Crow?

Thanks

ipkn commented 7 years ago

Crow doesn't support DB access. You need to use another library for it. If you want to do db jobs in type-safe way, you should check https://github.com/rbock/sqlpp11.

Also crow is just a web server framework, it lacks an API for requesting another web server.

bnlambert commented 7 years ago

Any thoughts on how handle middleware in Crow? the documentation seems to be lacking that at the moment. The given link https://github.com/ipkn/crow/issues/239#issuecomment-327389344, is not available.

ipkn commented 7 years ago

middleware is a plug-in system for crow that runs before or after the user handler. You can see the example implementation in middleware.h (CookieParser).

bnlambert commented 7 years ago

Please share a link, I am unable to find it in the branch.

bnlambert commented 7 years ago

I found a link here https://github.com/ipkn/crow/blob/master/include/crow/middleware.h . Thanks