• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MakefileH A D23-May-20211.4 KiB5025

README.mdH A D23-May-20211.7 KiB3423

simple_example.cH A D23-May-20218.9 KiB239159

README.md

1# simple_example
2
3Run a simple webservice that listen on port 8537.
4
5## Compile and run
6
7```bash
8$ make test
9```
10
11## Compile with Ulfius built as a static archive
12
13Ulfius must be built as a static archive and installed in the $(PREFIX) directory.
14
15```bash
16$ make static
17```
18
19### https connection
20
21If you want this program to listen to a secure (https) connection, create a certificate with its certificate and private keys in to separate files, and run the program with the options `-secure <key_file> <cert_file>`.
22
23## Endpoints available:
24
25- `GET http://localhost:8537/test`: A "Hello World!" response (status 200)
26- `GET http://localhost:8537/test/empty`: An empty response (status 200)
27- `POST http://localhost:8537/test`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
28- `GET http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
29- `POST http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
30- `PUT http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
31- `DELETE http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
32- `GET http://localhost:8537/test/multiple/:multiple/:multiple/:not_multiple`: Will display all requests parameters (body, headers, cookies, etc.) given by the client, and multiple values in `map_url:multiple` key
33- `GET http://localhost:8537/testcookie/:lang/:extra` Will send a cookie to the client with `lang` and `extra` values in it
34