-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat/bind-and-listen
- Loading branch information
Showing
53 changed files
with
965 additions
and
2,574 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Feature CI | ||
|
||
on: | ||
push: | ||
branches: [feature/*] | ||
pull_request: | ||
branches: [main, develop] | ||
|
||
jobs: | ||
feature-ci: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up C++ environment | ||
uses: aminya/setup-cpp@v1 | ||
|
||
# start test coverage using this tool or gcov | ||
- name: Install gcovr | ||
run: sudo apt-get install -y gcovr | ||
|
||
- name: Compile Webserv | ||
run: make | ||
|
||
- name: Run Code | ||
run: | | ||
make run & | ||
SERVER_PID=$! | ||
sleep 3 | ||
- name: Stop Webserv | ||
run: kill -SIGINT $SERVER_PID || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,6 @@ | |
bin/ | ||
build/ | ||
webserv | ||
.idea | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
# webserv | ||
This is when you finally understand why a URL starts with HTTP | ||
|
||
|
||
```mermaid | ||
flowchart TD | ||
A[Introduction to HTTP] --> B[Overview of HTTP server] | ||
B --> C[Primary function of a web server] | ||
C --> D[Request/Response model] | ||
D --> E[Role of client and server] | ||
A1[General rules] --> F[Program Stability] | ||
F --> G[No crashing or unexpected quit] | ||
F --> H[Makefile structure] | ||
F --> I[Use C++ 98 standard] | ||
F --> J[Forbidden libraries] | ||
A2[Mandatory Part] --> K[Program name: webserv] | ||
K --> L[HTTP server in C++ 98] | ||
L --> M[Command to run: ./webserv config_file] | ||
L --> N[Requirements] | ||
N --> O[Non-blocking I/O using poll or equivalent] | ||
N --> P[Configuration file handling] | ||
N --> Q[GET, POST, DELETE methods support] | ||
N --> R[Serve static content] | ||
N --> S[Handle file uploads] | ||
N --> T[Multiple ports support] | ||
A3[For MacOS only] --> U[Use of fcntl] | ||
A4[Configuration File] --> V[Define server host and port] | ||
V --> W[Set up server_names] | ||
W --> X[Configure routes for files] | ||
X --> Y[Enable CGI execution] | ||
X --> Z[Handle uploads and directory listing] | ||
A5[Bonus Part] --> AA[Support cookies and session management] | ||
AA --> AB[Handle multiple CGI scripts] | ||
A6[Submission and Peer Evaluation] --> AC[Submit via Git repository] | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
server { | ||
host 127.0.0.1; | ||
port 8080; | ||
server_names example.com www.example.com; | ||
client_max_size 10M; | ||
|
||
error_pages { | ||
404 /errors/404.html; | ||
500 /errors/500.html; | ||
} | ||
|
||
location / { | ||
methods GET POST DELETE; | ||
root /var/www/html; | ||
directory_list on; | ||
index index.html; | ||
client_max_size 20M; | ||
|
||
cgi { | ||
extension .php; | ||
path /usr/bin/php-cgi; | ||
} | ||
|
||
upload { | ||
path /var/www/uploads; | ||
max_size 5M; | ||
} | ||
} | ||
|
||
location /redirect { | ||
redirect { | ||
code 301; | ||
url /new-location; | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.