Skip to content

Commit fbb409b

Browse files
committed
modify api comment.
1 parent 033ad35 commit fbb409b

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

src/api.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ std::string ipToString(const sockaddr_in& addr)
5454
* on port 80. The server processes GET requests with start and end node parameters
5555
* and returns the shortest path result in JSON or XML format.
5656
*
57-
* Functionality:
58-
* - Initializes and configures a network socket.
59-
* - Parses incoming HTTP GET requests.
60-
* - Computes the shortest path based on user-provided parameters.
61-
* - Constructs and sends an appropriate JSON/XML response.
62-
*
6357
* Steps of Execution:
6458
* - Step 1: Initialize Network Socket
6559
* - On Windows, initializes Winsock (`WSAStartup`).
@@ -96,52 +90,6 @@ std::string ipToString(const sockaddr_in& addr)
9690
* - No Path Found → Returns `404 Not Found`.
9791
* - Unsupported Accept Headers → Returns `400 Bad Request`.
9892
*
99-
* Supported HTTP Requests:
100-
* ```
101-
* GET /?start=NODE_A&end=NODE_B&weight=1.2 HTTP/1.1
102-
* ```
103-
* - `start` → Required, start node ID.
104-
* - `end` → Required, destination node ID.
105-
* - `weight` → Optional, heuristic weight factor (1.0 - 2.0).
106-
* - Accept Header:
107-
* - `application/json` → Returns JSON.
108-
* - `application/xml` → Returns XML.
109-
*
110-
* Response Formats:
111-
* - JSON Example:
112-
* ```
113-
* {
114-
* "status": { "message": "OK", "code": 200 },
115-
* "response_time": 15,
116-
* "req": { "start": 12, "end": 45, "weight": 1.2 },
117-
* "res": {
118-
* "total_time": 300,
119-
* "total_node": 5,
120-
* "itinerary": [12, 18, 30, 45]
121-
* }
122-
* }
123-
* ```
124-
* - XML Example:
125-
* ```
126-
* <response>
127-
* <status>
128-
* <message>OK</message>
129-
* <code>200</code>
130-
* </status>
131-
* <response_time>15</response_time>
132-
* <req>
133-
* <start>12</start>
134-
* <end>45</end>
135-
* <weight>1.2</weight>
136-
* </req>
137-
* <res>
138-
* <total_time>300</total_time>
139-
* <total_node>5</total_node>
140-
* <itinerary>12,18,30,45</itinerary>
141-
* </res>
142-
* </response>
143-
* ```
144-
*
14593
* @param gdata The graph data structure used for shortest path calculations.
14694
* @param conf The configuration settings for the API.
14795
* @return `0` on success, `1` on failure.

0 commit comments

Comments
 (0)