Reference
Drash is split into three codebases, and this reference follows that split. Imports flow one direction — Modules → Standard → Core — which is what keeps each layer independently useful. Framework covers the reasoning; these pages cover the API.
The Three Layers
| Layer | What it holds | Imports |
|---|---|---|
| Core | Types, interfaces, enums, HTTPError, and the base Resource. The lowest-level APIs. | Nothing |
| Standard | Standalone library code, in the spirit of Deno’s or Go’s standard library — handlers, middleware, loggers. | Core |
| Modules | The pieces that do the work: the HTTP module, the pre-built middleware, the builders. | Standard, Core |
Where to Start
Most applications only touch Modules. The two entry points — modules/http.native.js and modules/http.polyfill.js — re-export what you need from the layers below, so a normal app imports Application, Resource, Middleware, ResourceGroup, and HTTPError from one specifier.
| If you want to | Read |
|---|---|
| Build and run an HTTP application | Application |
| Write a resource | Resource |
| Throw and catch errors | HTTPError |
| Attach middleware or prefixes | Resource groups |
| Use a pre-built middleware | CORS and its siblings |
| Add a step of your own to the chain | Handlers |
Supply your own URLPattern | URLPattern |
Looking for Something Else?
- Middleware — writing your own, and the four bundled ones.
- Creating a Resource — paths, HTTP methods, and dynamic paths.
- Examples — complete applications you can run.
Last updated on