oneshotserver

Crates.iooneshotserver
lib.rsoneshotserver
version1.0.0
sourcesrc
created_at2023-01-07 00:47:17.348486
updated_at2023-01-07 00:47:17.348486
descriptionA quick utility to create a simple web server which blocks the current thread until the first request is served. Usecases include handling incoming requests for usecases like OAuth token generation etc.
homepagehttps://github.com/Surya-06/rust-oneshotserver
repositoryhttps://github.com/Surya-06/rust-oneshotserver
max_upload_size
id752702
size6,899
Surya Prakash Susarla (surya-prakash-susarla)

documentation

README

ONE-SHOT-SERVER

This is a crate for usecases where simple incoming http requests are to be handled for further data extraction. Usecases include OAuth token fetches where the token is usually sent as a response to a local webpage.

Usage

This crate only has one function start_listening_for_request which takes a port number where the server will be hosted and a closure which runs after the incoming request is received. The request is handed over to the closure for further usage.

The function runs synchronously while blocking the thread where it is invoked on.

Commit count: 24

cargo fmt