{"id":17062332,"url":"https://github.com/devpaul/webserv","last_synced_at":"2025-04-12T18:13:19.047Z","repository":{"id":39042578,"uuid":"78155797","full_name":"devpaul/webserv","owner":"devpaul","description":"A development web server written in TypeScript","archived":false,"fork":false,"pushed_at":"2022-12-11T07:33:42.000Z","size":1738,"stargazers_count":6,"open_issues_count":19,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T18:13:11.354Z","etag":null,"topics":["proxy","server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devpaul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-05T23:09:45.000Z","updated_at":"2022-07-24T20:10:47.000Z","dependencies_parsed_at":"2023-01-26T18:16:30.591Z","dependency_job_id":null,"html_url":"https://github.com/devpaul/webserv","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fwebserv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fwebserv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fwebserv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devpaul%2Fwebserv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devpaul","download_url":"https://codeload.github.com/devpaul/webserv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610342,"owners_count":21132919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["proxy","server","typescript"],"created_at":"2024-10-14T10:49:43.881Z","updated_at":"2025-04-12T18:13:19.025Z","avatar_url":"https://github.com/devpaul.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webserv\n\n[![Build Status](https://travis-ci.org/devpaul/webserv.svg?branch=master)](https://travis-ci.org/devpaul/webserv)\n[![Windows build status](https://ci.appveyor.com/api/projects/status/pwxbf43ctu05uxn8?svg=true)](https://ci.appveyor.com/project/devpaul/webserv)\n[![npm version](https://badge.fury.io/js/webserv.svg)](https://badge.fury.io/js/webserv)\n\n## Why use `webserv`?\n\nWebserv'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.\n\nServe a folder right now without installing anything using `npx`.\n\n```\nnpx webserv\n```\n\nWebserv comes with standard server patterns. Start a proxy, CRUD server, upload, or log connections from the command-line. Have a more complex use case? `webserv` supports JSON configs and has a fully-typed programmatic API so you will *never* be stuck.\n\nWant to learn more? Look at our [examples](https://github.com/devpaul/webserv/tree/master/examples) and read through our [documentation](https://github.com/devpaul/webserv/tree/master/docs).\n\n## Command Line\n\nWebserv allows you to quickly start a fully fledged development server from the command line without editing a single file.\n\n### Command-line Options\n\n#### -m, --mode { http | https }\n\nCreate a `http` or `https` server (defaults to http)\n\n```\nwebserv -m https\n```\n\nhttps servers will auto-generate self-signed certificates\n\n#### -l, --log\n\nLog all requests to the console\n\n```\nwebserv -l\n```\n\n#### -p, --port\n\nSet the port to use (defaults to 8888)\n\n```\nwebserv -p 8000\n```\n\n#### -t crud\n\nStart a basic CRUD server\n\n```\nwebserv -t crud\n```\n\nThis server keeps records in an internal store.\n\n* GET `/` will list all of the records\n* POST `/` with a json object in the body with an `id` to add a record\n* PUT `/` with a json object in the body to update a record\n* GET `/id/:id` to view a single record\n* DELETE `/id/:id` to delete a record\n\n#### -t file {directory}\n\nServe the directory.\n\nThis is the default server type. If the `directory` is omitted the current directory will be served.\n\n```\nwebserv -t file ./dist\n```\n\n#### -t log\n\nCreate a log server that logs all request to the console and returns 200.\n\n```\nwebserv -t log\n```\n\n#### -t proxy {target}\n\nCreate a proxy server.\n\n```\nwebserv -t proxy http://devpaul.com\n```\n\n#### -t upload {directory}\n\nCreate an upload server.\n\n`directory` is the location where uploaded files will be stored\n\n```\nwebserv -t upload ./files\n```\n\n* GET `/` provides an interface to upload files\n* POST `/` uploads the file(s)\n* GET `/list` lists files that have been uploaded\n\n## webserv configuration\n\nWebserv supports more complex usage through config files. When a file named `webserv.json` is present or when `webserv` is launched using the `-c \u003cconfigPath\u003e` option, webserv will launch using the provided configuration.\n\nThe available configurations match the server types (available with the `-t` option): crud, file, log, proxy, and upload.\n\nSee the [configuration documentation](https://github.com/devpaul/webserv/blob/master/docs/configuration.md) for all of the details.\n\n## Programmatic API\n\nFor users that may need to create their own services or have complex use cases that are not served the configuration, `webserv` offers a fully-typed programmatic API written in TypeScript. See the [hello world example](https://github.com/devpaul/webserv/blob/master/examples/hello-world/services/hello.ts) for example usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaul%2Fwebserv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevpaul%2Fwebserv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaul%2Fwebserv/lists"}