Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Martin Chang
    @marty1885
    The latest PR makes some C++17 builds depend on Boost and Boost.Filesystem. (That what the CMake error is trying to tell you)
    Unable to find the requested Boost libraries.
    Chung
    @chungwong
    Thanks, I was reading the wiki boost, the version should be no less than 1.61, is required only if the C++ compiler does not support C++ 17. And couldn't tell if I need to install it
    Martin Chang
    @marty1885
    The PR was merged a day ago. We haven't updated the doc yet. Consider the docs to be correct for the releases. Not for the bleeding edge.
    Chung
    @chungwong
    Thanks, I installed libboost-all-dev for the peace of mind for now, although it installed a lot of deps which are unncessary.
    All worked!
    Aayush-2492
    @Aayush-2492

    I don't think so. We do have an example with axios. frontend backend

    Thanks for the help

    I want to make a chat room that does:

    1. When the send button is pressed client side uses DOM manip to get that string
    2. Using websockets, it sends it to the server.
    3. Server manipulates the DOM to add the new message in an html file so that every other client in the chatroom can see that message.

    Could anyone suggest a suitable front-end framework I could explore to achieve this task.

    interfector18
    @interfector18
    Vue is really good and easy to pick up, the frontend example you linked actually uses vue
    You should also look at awesome vue, to see if there are companion libraries you could use
    João Fernandes
    @0rangeFox
    In my opinion, I would suggest React with Redux and Axios.

    You can try using the ucrt (MSYS UCRT) environment and compile with clang (with -std=c++20 -fcoroutine-ts). Clang's coroutine may work with MSVC's STL.

    When I have plenty of time for these experiments I will test this, for now I am using my Linux server which works best.

    Aayush-2492
    @Aayush-2492
    Thanks for the suggestions @0rangeFox and @interfector18
    João Fernandes
    @0rangeFox
    You're welcome!
    Kaung Zaw Htet
    @KaungZawHtet
    Try flutter. Vue is just for web frontend. Flutter is for any kind of frontend: web, mobile and even desktop.
    N most popular choice in nowadays
    Chung
    @chungwong
    How do I actually add Drogon to CTest? I am a bit confused about the doc given that I am still new to C++

    I created the following under Drogon root dir with some dummy tests.

    tests
    ├── CMakeLists.txt
    └── main.cc

    when I did

    cd build
    cmake ..
    make && make test

    everything worked. However, when I tried to add drogon into CTest.
    file: test/CMakeLists.txt

    add_executable(main main.cc)
    add_test(main main)
    
    # FIXME
    # include(ParseAndAddDrogonTest)
    # add_executable(main main.cc)
    # target_link_libraries(main PRIVATE drogon)
    # ParseAndAddDrogonTest(main)

    It threw an error at me

    CMake Error at tests/CMakeLists.txt:5 (include):
      include could not find load file:
    
        ParseAndAddDrogonTest
    Chung
    @chungwong
    and I cannot find a reference to ParseAndAddDrogonTest in the whole source code.
    Did I get the idea wrong?
    João Fernandes
    @0rangeFox
    @chungwong Hey, I didn't understand, so, you mean, add framework "Drogon" to your project?
    Chung
    @chungwong
    @0rangeFox not really, I mean adding unit test to my drogon project
    which is integrating the testing framework of Drogon into CTest
    João Fernandes
    @0rangeFox
    Just curiosity, don't take it in bad way, mind I ask why you want it for?
    Chung
    @chungwong
    My hobby project at this moment doesn't have any unit testing. So it would be great if I can test the URLs I have made
    João Fernandes
    @0rangeFox
    Ah sure, I can recommend you the Postman application for it.
    Chung
    @chungwong
    but I guess it is not really testing? In that case I can use cURL to do that too?
    João Fernandes
    @0rangeFox
    Well, I use debugger from IDE and Postman to call it for check if everything is fine. But of course, you can use cURL for it.
    Chung
    @chungwong
    it would be great if we can just run make test to run all unit tests.
    I am just not familiar with how I should integrate drogon test to CTest
    Martin Chang
    @marty1885
    Hi @chungwong. That is a quark of CMake. There's no formal way to distribute cmake modules. The best we could do is to distribute it with the source and install is somewhere on your system.
    Either copy the file into your project and point CMAKE_MODULE_PATH to the containing folder. Or add this line somewhere before the include set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} /usr/lib/cmake/Drogon")(if you are on UNIX and installed drogon to /usr.
    In short:
    Chung
    @chungwong
    aha, no wonder I couldn't find any reference to ParseAndAddDrogonTest in the source. It is actually ParseAndAddDrogonTests
    Martin Chang
    @marty1885
    mkdir cmake
    wget "https://github.com/an-tao/drogon/blob/d888816997969435b907bec3881df7f4229f3583/cmake/ParseAndAddDrogonTests.cmake" -O cmake/ParseAndAddDrogonTests.cmake
    Then add set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake") somewhere at the beginning of your CMake script.
    Ah yes. I should fix that typo :P
    Chung
    @chungwong
    Thanks Martin. Let me try it out
    wait a second. I just realised I copied a template/file from Drogon's source code into my project, and then make some changes to my CMakeLists.txt. Isn't it the job of the generator Drogon has been using for generating the project template drogon_ctl create project your_project_name
    Martin Chang
    @marty1885
    You can customize the template as much as you wish.
    And we don't want to force users to use our own testing framework. Choosing testing frameworks is a touchy subject.
    Chung
    @chungwong
    of course not. However, what about
    drogon_ctl create project your_project_name --include_drogon_test
    Martin Chang
    @marty1885
    Good idea! You should open an issue and we could discuss in detail there
    Chung
    @chungwong
    Alababdiy
    @Alababdiy
    image.png
    My application not load controller
    image.png
    image.png
    image.png
    The messenger_receiver controller not registered on app when i request /view got 404 not found
    João Fernandes
    @0rangeFox
    Hey @Alababdiy, are you loading these controllers on CMakeLists?
    Aayush-2492
    @Aayush-2492
    does newHttpViewResponse() take only the name of .csp file or is .html also fine?
    An Tao
    @an-tao
    must be .csp, but it's content can be anything including HTML docs
    Martin Chang
    @marty1885
    There's also CSP syntax highlighting support for VSCode: https://marketplace.visualstudio.com/items?itemName=marty1885.drogon-csp-lanuage