Webserv is the fastest way to create a server for development.
Serve your folder right now without installing anything using npx
.
npx webserv
Webserv comes packed with standard server patterns. Start a proxy, CRUD server, upload, or log connections from the command-line or use webserv
's fully typed API to programmatically create a custom server.
Webserv allows you to quickly start a fully fledged development server from the command line without editing a single file.
Start a https server with self-signed certificate like this:
webserv -m https -t file ./_dist -p 9999
Create a http
or https
server (defaults to http)
ngrok
mode will create a local http
server and use ngrok to create an externally accessible site on ngrok. The public url will be displayed on the console.
webserv -m https
Log all requests to the console
webserv -l
Set the port to use (defaults to 8888)
webserv -p 8000
Start a basic CRUD server
webserv -t crud
This server keeps records in an internal store.
- GET
/
will list all of the records - POST
/
with a json object in the body with anid
to add a record - PUT
/
with a json object in the body to update a record - GET
/id/:id
to view a single record - DELETE
/id/:id
to delete a record
Serve the directory.
This is the default server type. If the directory
is omitted the current directory will be served.
webserv -t file ./dist
Create a log server that logs all request to the console and returns 200.
webserv -t log
Create a proxy server.
webserv -t proxy https://devpaul.com
Create an upload server.
directory
is the location where uploaded files will be stored
webserv -t upload ./files
- GET
/
provides an interface to upload files - POST
/
uploads the file(s) - GET
/list
lists files that have been uploaded
Webserv offers a fully-typed programmatic API. See ./examples/hello
and ./src/webserv/bin/webserv.ts
.
Webserv's aim is to have a fast, simple way to provide a backend to your projects. We want to enable developers to start working on their experience immediately. Webserv is not, nor will ever be a production-ready server (for that we recommend Nestjs). Instead it is a quick and easy way to start serving your app with zero thought or investment.