All Projects → amphp → http-server-static-content

amphp / http-server-static-content

Licence: MIT license
Static content / file serving for Amp's HTTP server.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to http-server-static-content

Miniserve
🌟 For when you really just want to serve some files over HTTP right now!
Stars: ✭ 2,894 (+15131.58%)
Mutual labels:  http-server, static-files
Http Server
A non-blocking HTTP application server for PHP based on Amp.
Stars: ✭ 1,122 (+5805.26%)
Mutual labels:  http-server, amphp
hello
Multi-threaded cross-platform HTTP/1.1 web server example in Zig.
Stars: ✭ 29 (+52.63%)
Mutual labels:  http-server
asynit
🌠 Asynchronous HTTP Request Testing Library for API or more...
Stars: ✭ 74 (+289.47%)
Mutual labels:  amphp
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (+42.11%)
Mutual labels:  http-server
waspy
WASP framework for Python
Stars: ✭ 43 (+126.32%)
Mutual labels:  http-server
rux
⚡ Rux is an simple and fast web framework. support route group, param route binding, middleware, compatible http.Handler interface. 简单且快速的 Go api/web 框架,支持路由分组,路由参数绑定,中间件,兼容 http.Handler 接口
Stars: ✭ 81 (+326.32%)
Mutual labels:  http-server
EasyDSS
high performance,industrial rtmp streaming server,a lot of optimization on http,rtmp,hls,http-flv,streaming relay(rtmp pull relay/rtmp push relay),KeyFrame cache,GOP cache,RESTful,and recording, playback, record-download,web management. EasyDSS高性能RTMP流媒体服务器,支持RTMP推流,同步输出HTTP、RTMP、HLS、HTTP-FLV,支持推流分发/拉流分发,支持秒开、GOP缓冲、录像、检索、回放、录像下载、网页管理等多种功能,是目前市面上…
Stars: ✭ 34 (+78.95%)
Mutual labels:  http-server
zipstream
A command line tool that allows you to easily share files and directories over the network
Stars: ✭ 49 (+157.89%)
Mutual labels:  http-server
Funk
Funk is a HTTP server implementation of PHPSGI. Implemented the lightweight middlewares, responder components...
Stars: ✭ 16 (-15.79%)
Mutual labels:  http-server
zhamao-framework
协程、高性能、灵活的聊天机器人 & Web 开发框架(炸毛框架)
Stars: ✭ 99 (+421.05%)
Mutual labels:  http-server
http
Extension module of golang http service
Stars: ✭ 57 (+200%)
Mutual labels:  http-server
HTTPStaticServer
Bare-bones static HTTP server written in a single C file
Stars: ✭ 24 (+26.32%)
Mutual labels:  http-server
drogon
Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
Stars: ✭ 7,742 (+40647.37%)
Mutual labels:  http-server
mock-json-server
A mock web server using a JSON file with live-reload support.
Stars: ✭ 31 (+63.16%)
Mutual labels:  http-server
AutoIt-HTTP-Server
A simple http server powered by AutoIt
Stars: ✭ 14 (-26.32%)
Mutual labels:  http-server
phpkoa
PHP异步编程: 基于 PHP 实(chao)现(xi) NODEJS web框架 KOA。
Stars: ✭ 52 (+173.68%)
Mutual labels:  http-server
BCA-Phantom
A multi-platform HTTP(S) Reverse Shell Server and Client in Python 3
Stars: ✭ 80 (+321.05%)
Mutual labels:  http-server
http4s-good-practices
Collection of what I consider good practices in Http4s (WIP)
Stars: ✭ 74 (+289.47%)
Mutual labels:  http-server
dummyhttp
Super simple HTTP server that replies a fixed body with a fixed response code
Stars: ✭ 25 (+31.58%)
Mutual labels:  http-server

http-server-static-content

This package provides a static content RequestHandler for Amp's HTTP server.

Usage

DocumentRoot implements RequestHandler.

Example

<?php

use Amp\Http\Server\RequestHandler\CallableRequestHandler;
use Amp\Http\Server\Response;
use Amp\Http\Server\Router;
use Amp\Http\Server\Server;
use Amp\Http\Server\StaticContent\DocumentRoot;
use Amp\Http\Status;

$documentRoot = new DocumentRoot(__DIR__ . '/public');

$router = new Amp\Http\Server\Router;

$router->addRoute('GET', '/', new CallableRequestHandler(function () {
    return new Response(Status::OK, ['content-type' => 'text/plain'], 'Hello, world!');
}));

$router->setFallback($documentRoot);

$server = new Server(..., $router, ...);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].