supamii / qttpserver Goto Github PK
View Code? Open in Web Editor NEWThis project forked from d5/node.native
Build your API with C++ - Powered by Qt and Node's libuv
Home Page: https://supamii.github.io/qttpserver/
License: MIT License
This project forked from d5/node.native
Build your API with C++ - Powered by Qt and Node's libuv
Home Page: https://supamii.github.io/qttpserver/
License: MIT License
I have built the example projects and when using Postman to test the end-points it fails for every other request.
After digging down it seems that connections are not being kept alive.
the global.json has a bindIp attribute ... is it possible to state a domain name name like myserver.com/api ?
thanks !
can u provide latest version of QttpServer code .
possibly use more PIMPL
is it possible to enable hooks for this server. or using it limits you to polling once you were served with a request for a long operation ?
thank a lot.
adiel.
this is not a bug or feature request, just help needed.
Win10, vc14, x64.
to avoid a pain with a building and installing mongoDB manually,
(I'm newbie in mongodb),
I've just used usual (for Win) way : vcpkg install mongo-cxx-driver:x64-windows.
so this was downloaded with a dependencies , built and installed successfully.
however , I don't see there the includes from the example:
#include <mongo/client/dbclient.h>
it contains a number of heades like "mongoc-.h" and "mongocxx/.hpp"
could you clarify how to use mongo driver in a projects instaled via visual c++ package manager?
thank you
I've tried to get qttp server to run inside a thread created with pthread, however doesn't works. But if I call qttp server from main function, all works fine.
Any advices about how to fix it.
Thanks.
Sometimes the server can run into a race condition while processing events, which leads to a memory access violation and causes the program to crash.
The main thread receives events from qt and calls the default event handler.
This eventually leads to a call to uv_write() on QttpResponse::close().
The second thread is started in HttpServer::startServer and runs a libuv event loop.
The issue seems to come from the uv_write() call in the main thread. According to the libuv devs, this call is not safe and should be moved to the event thread using uv_async_send:
https://groups.google.com/forum/#!topic/libuv/iHzv3x-VOr4
Hi, may I ask if QttpServer allows to upload/transfer not only JSON message with PUT/GET operations but big multimedia files or any binary file attached to a query/response? Is this possible or need to use other tools? If possible: could You provide some example please? Thanks!
I didnt see any info about ssl certifcate integration. Doesn't qttpserver support https?
When I compile QttpServer on windows 10 using QtCreator (with MSVC2015_64bit) I get this compile error:
QttpServer\lib\http\src\stream.cc:90: error: C2397: conversion from 'std::size_t' to 'ULONG' requires a narrowing conversion
I've successfully built QttpServer, however if I try to build my application I get linking errors:
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lnode_native
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -luv
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find -lhttp_parser
collect2: error: ld returned 1 exit status
My .pro file is:
QT -= gui
TARGET = my_server
CONFIG += c++11 console
CONFIG -= app_bundle
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += main.cpp
message('Including config files')
include($$PWD/config/config.pri)
message('Including QttpServer core files')
include($$PWD/qttpserver/core.pri)
What is the problem could be here? Wrong core.pri
if application sources located outside qttpserver sources? Include some more?
please assist with an understanding the API
could you provide with a sample code (in case of this is possible technically),
when one class registers a number of routes , how e.g. OnGet methos can recognize from which route/uri this was called?
and also parsing URL parameters like /?param1=value¶m2=value2
I have a complicated application that requires many commandline options to be set.
However the first thing I need to start is the HttpServer, which is pulling args directly from QCoreApplication::instance().
Because the httpServer->initialize() uses m_ComandLineParser.process(*app) it fails with "Unknown options: my-custom-parameter".
Currently the Swagger description and summary of each action is used for all routes, e.g. given an Action
named Foo
with two routes (one GET and on POST for the usual collection interface) both routes will have the exact same description and summary (Foo->getDescription()
and Foo->getSummary()
) shown in Swagger.
While there may be some Action
s where this makes a lot of sense, at least in the case of generic collections it does not.
My proposal would be to return maps from both these functions:
virtual const char* getDescription() const;
virtual const char* getSummary() const;
would then become
virtual const std::map<qttp::HttpPath, const char*> getDescription() const;
virtual const std::map<qttp::HttpPath, const char*> getSummary() const;
Swagger::initialize()
would have to be changed accordingly.
I think this would not be such a big change, but really help with usability of the generated Swagger documentation. I'd be willing to implement this, if you don't see any roadblocks and would accept a pull request.
Hi there,
I've followed the steps from the main page but when I try to compile the qhttpserver.pro
I get the following errors:
WARNING: Failure to find: C:/QttpServer/lib/libuv_qmake/../libuv/src/*.c
WARNING: Failure to find: C:/QttpServer/lib/libuv_qmake/../libuv/src/win/*.c
WARNING: Failure to find: C:/QttpServer/lib/libuv_qmake/../libuv/src/*.c
WARNING: Failure to find: C:/QttpServer/lib/libuv_qmake/../libuv/src/win/*.c
C:\QttpServer\build\debug\lib\libuv_qmake\Makefile.Debug:113: warning: overriding recipe for target 'debug/*.o'
C:\QttpServer\build\debug\lib\libuv_qmake\Makefile.Debug:110: warning: ignoring old recipe for target 'debug/*.o'
fatal error: cannot specify -o with -c, -S or -E with multiple files
Any suggestions?
I'm using Qt 5.7
on Windows 7 (32-bit)
.
Hello! I see that the examples handle the request synchronously (in onGet for instance). What about async responses? Can I somehow send the response once some processing is completed without keeping that thread busy?
Thanks.
swagger inputs apply to all routes/entire-action
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.