|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Matches API request paths against the dispatch table and resolves the response artifact file to serve. More...
#include "native_dispatch_table.h"#include "native_json_config.h"#include "native_support.h"#include <stdlib.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | native_dispatch_strdup strdup |
Functions | |
| int | native_dispatch_route_pattern_matches (const char *pattern, const char *path) |
| Tests whether a request path matches one dispatch-table route pattern. | |
| char * | native_dispatch_response_file_for_request (const char *root, const char *method, const char *path) |
| Resolves the response artifact file for one request using the dispatch table. | |
Matches API request paths against the dispatch table and resolves the response artifact file to serve.
Definition in file native_dispatch_table.c.
| #define native_dispatch_strdup strdup |
Definition at line 17 of file native_dispatch_table.c.
Referenced by native_dispatch_response_file_for_request().
| char * native_dispatch_response_file_for_request | ( | const char * | root, |
| const char * | method, | ||
| const char * | path ) |
Resolves the response artifact file for one request using the dispatch table.
| root | Artifact root directory containing dispatch metadata. |
| method | HTTP method for the request. |
| path | Normalized request path. |
Definition at line 47 of file native_dispatch_table.c.
References json_find_string_after(), native_dispatch_route_pattern_matches(), native_dispatch_strdup, path_join(), read_file_text(), starts_with(), and streq().
Referenced by native_dynamic_dispatch_response_file(), and native_serve_static_file().
| int native_dispatch_route_pattern_matches | ( | const char * | pattern, |
| const char * | path ) |
Tests whether a request path matches one dispatch-table route pattern.
| pattern | Dispatch-table route pattern. |
| path | Normalized request path to test. |
Definition at line 20 of file native_dispatch_table.c.
Referenced by native_dispatch_response_file_for_request().