Skip to content

Commit

Permalink
att
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmoutinho committed Jul 11, 2024
1 parent d2665d7 commit dbb09d1
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.d
out_folder
CWebStudio_test.h
*.pyc
# Object files
*.o
*.ko
Expand Down
103 changes: 103 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion CWebStudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -5639,7 +5639,6 @@ char* cweb_replace_string(const char *target, const char *old_element, const cha
unsigned char *cweb_load_any_content(const char * path,int *size,bool *is_binary){
FILE *file = fopen(path,"rb");
if(file == NULL){
free(file);
return NULL;
}
fseek(file,0,SEEK_END);
Expand Down
1 change: 0 additions & 1 deletion src/extras/extras.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
unsigned char *cweb_load_any_content(const char * path,int *size,bool *is_binary){
FILE *file = fopen(path,"rb");
if(file == NULL){
free(file);
return NULL;
}
fseek(file,0,SEEK_END);
Expand Down
15 changes: 15 additions & 0 deletions teste.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "CWebStudio.h"
CwebNamespace cweb;

struct CwebHttpResponse *main_sever(struct CwebHttpRequest *request ){

const char *html = "<html><body><h1>Hello World</h1></body></html>";
return cweb.response.send_any("text/html",strlen(html),(unsigned char*)html,200);
}

int main(int argc, char *argv[]){
cweb = newCwebNamespace();
CwebServer server = newCwebSever(5000, main_sever);
cweb.server.start(&server);
return 0;
}

0 comments on commit dbb09d1

Please sign in to comment.