JSON demo server
Target for Exercise A: Custom editor tab. The server returns minified JSON so your custom JSON editor tab has something worth pretty-printing.
Run
No build step and no dependencies. Run it from IntelliJ or from a terminal.
IntelliJ
- Right-click the
srcfolder and go to New > Directory. IntelliJ suggests standard source folders: select test/java.
IntelliJ createssrc/test/javaand marks it as a test sources root. The starter project ships onlysrc/main/java, so you add this folder yourself. - Drag
JsonDemo.javainto the newsrc/test/javafolder. - Click the green Run arrow in the gutter next to
main, or right-click the file and click Run ‘JsonDemo.main()’.
IntelliJ runs the file with the project SDK. Keeping it in src/test/java also keeps it out of your extension JAR. Stop it with the red Stop button.
Terminal
You need a JDK 21 or later on your PATH:
java JsonDemo.java # http://localhost:8889
java JsonDemo.java 9000 # custom port
Stop with Ctrl+C.
Note: If you let IntelliJ download the JDK for you (File > Project Structure > SDK > Download JDK), that JDK is not on your terminal’s PATH. Running
java JsonDemo.javathen fails with a “command not found” error. Run it from IntelliJ instead, or install a standalone JDK 21.
Endpoints
| Path | Content-Type | Purpose |
|---|---|---|
/ |
text/html | Index with clickable links (browse to fill proxy history) |
/api/users |
application/json | A minified JSON array |
/api/order |
application/json | A minified nested object |
/api/deep |
application/json | Deeply nested minified JSON |
/api/not-json |
text/plain | Negative test: Burp does not show your JSON tab |
To view the responses:
- Click the browser icon in the top-right of Burp to open Burp’s browser, then go to http://localhost:8889/. This routes the traffic through Burp.
- View the
/api/*responses in the message editor.