You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.5 KiB

// Copyright (c) 2020 Lukasz Chodyla
// Distributed under the MIT License.
// See accompanying file LICENSE.txt for the full license.
#ifndef MAIN_HTTPHANDLERS_H_
#define MAIN_HTTPHANDLERS_H_
#include <stdint.h>
#include <stddef.h>
#include <string.h>
extern const char index_html_start[] asm("_binary_index_html_start");
extern const char index_css_start[] asm("_binary_index_css_start");
extern const char index_js_start[] asm("_binary_index_js_start");
extern const char sys_html_start[] asm("_binary_sys_html_start");
extern const char app_html_start[] asm("_binary_app_html_start");
static void rootHandler(const uint8_t* content, size_t ctLen,
const char** response, size_t* respLen)
{
*response = index_html_start;
*respLen = strlen(index_html_start);
}
static void jsHandler(const uint8_t* content, size_t ctLen,
const char** response, size_t* respLen)
{
*response = index_js_start;
*respLen = strlen(index_js_start);
}
static void cssHandler(const uint8_t* content, size_t ctLen,
const char** response, size_t* respLen)
{
*response = index_css_start;
*respLen = strlen(index_css_start);
}
static void sysFormHandler(const uint8_t* content, size_t ctLen,
const char** response, size_t* respLen)
{
*response = sys_html_start;
*respLen = strlen(sys_html_start);
}
static void appFormHandler(const uint8_t* content, size_t ctLen,
const char** response, size_t* respLen)
{
*response = app_html_start;
*respLen = strlen(app_html_start);
}
#endif /* MAIN_HTTPHANDLERS_H_ */