Skip to content

Commit 22f9714

Browse files
committed
add info on CGI web application debugging
1 parent 44d5293 commit 22f9714

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

debugging/index.md

+32
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,42 @@ This will compile Fano Framework web application with debugging information.
5353

5454
Back to Visual Studio Code IDE. Open source code file you want to debug and toggle breakpoint at line of interest by clicking on empty area left of line number. Activate *Run* tab click green button on left of *Debug Fano* to start debugging.
5555

56+
This will run application. Open Internet browser and type URL so that breakpoint is hit.
57+
5658
## Debugging in Lazarus IDE
5759

5860
*TODO*
5961

62+
## Debugging CGI web application
63+
64+
It may be tricky to debug CGI web applications as they are run by web server. However you can simulate running CGI script using `tools/simulate.run.sh` shell script that is generated when you use [Fano CLI](/scaffolding-with-fano-cli) to create project.
65+
66+
To debug CGI web application with Visual Studio Code, edit `launch.json`
67+
68+
```
69+
{
70+
"version": "0.2.0",
71+
"configurations": [
72+
{
73+
"name": "Debug Fano CGI",
74+
"type": "gdb",
75+
"request": "launch",
76+
"target": "./public/app.cgi",
77+
"env": {
78+
"REQUEST_METHOD": "GET",
79+
"REQUEST_URI" : "/some-url",
80+
"QUERY_STRING" : "order=123&user_id=12"
81+
}
82+
"cwd": "${workspaceRoot}",
83+
"valuesFormatting": "parseText"
84+
}
85+
]
86+
}
87+
```
88+
89+
This will simulate run CGI web application when open from Internat browser via URL
90+
`http://your.app/some-url?order=123&user_id=12`.
91+
6092
## Explore more
6193

6294
- [Getting started](/getting-started)

0 commit comments

Comments
 (0)