mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-11 13:21:10 +01:00
Added an api to the web server simple to add / remove mime types from scripts.
This commit is contained in:
parent
e0b2f048c2
commit
09acb9bfeb
@ -105,6 +105,13 @@ void WebServerSimple::set_worker_thread_count(const int val) {
|
||||
_worker_thread_count = val;
|
||||
}
|
||||
|
||||
void WebServerSimple::add_mime_type(const String &file_extension, const String &mime_type) {
|
||||
_server->mimes[file_extension] = mime_type;
|
||||
}
|
||||
void WebServerSimple::remove_mime_type(const String &file_extension) {
|
||||
_server->mimes.erase(file_extension);
|
||||
}
|
||||
|
||||
bool WebServerSimple::is_running() const {
|
||||
return _is_running;
|
||||
}
|
||||
@ -262,6 +269,9 @@ void WebServerSimple::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_worker_thread_count", "val"), &WebServerSimple::set_worker_thread_count);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "worker_thread_count"), "set_worker_thread_count", "get_worker_thread_count");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("add_mime_type", "file_extension", "mime_type"), &WebServerSimple::add_mime_type);
|
||||
ClassDB::bind_method(D_METHOD("remove_mime_type", "file_extension"), &WebServerSimple::remove_mime_type);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("is_running"), &WebServerSimple::is_running);
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,9 @@ public:
|
||||
int get_worker_thread_count();
|
||||
void set_worker_thread_count(const int val);
|
||||
|
||||
void add_mime_type(const String &file_extension, const String &mime_type);
|
||||
void remove_mime_type(const String &file_extension);
|
||||
|
||||
bool is_running() const;
|
||||
|
||||
void _start();
|
||||
|
Loading…
Reference in New Issue
Block a user