challenger-httpd_spa.h (1955B)
1 /* 2 This file is part of Challenger 3 Copyright (C) 2023 Taler Systems SA 4 5 Challenger is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Lesser General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 Challenger is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 Challenger; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file challenger-httpd_spa.h 18 * @brief logic to preload and serve static files 19 * @author Sebastian Marchano 20 * @author Christian Grothoff 21 */ 22 #ifndef CHALLENGER_HTTPD_SPA_H 23 #define CHALLENGER_HTTPD_SPA_H 24 #include <microhttpd.h> 25 #include "challenger-httpd.h" 26 27 28 /** 29 * Return our single-page-app user interface (see contrib/wallet-core/). 30 * 31 * @param rc context of the handler 32 * @param[in,out] args remaining arguments (ignored) 33 * @return #MHD_YES on success (reply queued), #MHD_NO on error (close connection) 34 */ 35 enum MHD_Result 36 CH_handler_spa (struct CH_HandlerContext *hc, 37 const char *upload_data, 38 size_t *upload_data_size); 39 40 41 /** 42 * Preload and compress SPA files. 43 * 44 * @return #GNUNET_OK on success 45 */ 46 enum GNUNET_GenericReturnValue 47 CH_spa_init (void); 48 49 50 /** 51 * Generates the response for "/", redirecting the 52 * client to the "/webui/" from where we serve the SPA. 53 * 54 * @param rh request handler 55 * @param connection MHD connection 56 * @param hc handler context 57 * @return MHD result code 58 */ 59 enum MHD_Result 60 CH_spa_redirect (struct CH_HandlerContext *hc, 61 const char *upload_data, 62 size_t *upload_data_size); 63 64 #endif 65 66 /* end of challenger-httpd_spa.h */