From 67de8b469aef9d7f52bd5016407350bba67800ef Mon Sep 17 00:00:00 2001
From: Gabriel Grubba <70247653+Grubba27@users.noreply.github.com>
Date: Mon, 22 Jan 2024 17:42:59 -0300
Subject: [PATCH] docs: add webapp
---
v3-docs/docs/packages/webapp.md | 171 ++++++++++++++++++++++++++++++++
1 file changed, 171 insertions(+)
create mode 100644 v3-docs/docs/packages/webapp.md
diff --git a/v3-docs/docs/packages/webapp.md b/v3-docs/docs/packages/webapp.md
new file mode 100644
index 0000000000..f78dc9a39e
--- /dev/null
+++ b/v3-docs/docs/packages/webapp.md
@@ -0,0 +1,171 @@
+# WebApp
+
+The `webapp` package is what lets your Meteor app serve content to a web
+browser. It is included in the `meteor-base` set of packages that is
+automatically added when you run `meteor create`. You can easily build a
+Meteor app without it - for example if you wanted to make a command-line
+tool that still used the Meteor package system and DDP.
+
+This package also allows you to add handlers for HTTP requests.
+This lets other services access your app's data through an HTTP API, allowing
+it to easily interoperate with tools and frameworks that don't yet support DDP.
+
+`webapp` exposes the [express](https://github.com/expressjs/express) API for
+handling requests through `WebApp.handlers`.
+Here's an example that will let you handle a specific URL:
+
+```js
+// Listen to incoming HTTP requests (can only be used on the server).
+WebApp.handlers.use("/hello", (req, res, next) => {
+ res.writeHead(200);
+ res.end(`Hello world from: ${Meteor.release}`);
+});
+```
+
+