libexpress 0.0.1
Express Server Framework in C
Loading...
Searching...
No Matches
Macros | Functions
express.h File Reference

This contains the entry point to the library. More...

#include "router.h"

Go to the source code of this file.

Macros

#define MAX_CON   100
 Maximum simultaneous connections accepted by server instance.
 

Functions

server_tserver_new (void)
 Creates a new server instance. More...
 
void server_listen (server_t *server, port_t port)
 Makes the server instance listen for HTTP requests at specified port. More...
 

Detailed Description

This contains the entry point to the library.

It contains and imports all the functions that are made public to the user.

Author
Saurav Pal (resyfer)
Bug:
No known bugs

Function Documentation

◆ server_listen()

void server_listen ( server_t server,
port_t  port 
)

Makes the server instance listen for HTTP requests at specified port.

The server instance listens for HTTP requests at the specified port and accepts requests from a maximum of MAX_CON clients.

Since server_t and router_t are the same types, any router can be made to listen for connections, not just the server-instance. However, all routes requested will be resolved according to the router listening to the connection.

Parameters
serverThe server instance
portThe port on which the server instance will listen for requests

◆ server_new()

server_t * server_new ( void  )

Creates a new server instance.

Returns
A server instance.
Warning
Please keep only one instance per application.