- v3.0.0-beta.2Latest
- v3.0.0-beta.1
- v3.0.0-preview.4
- v2.8.1
- v2.7.1
- v2.7.0
- v2.6.0
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v2.0.0-rc-2
- v2.0.1-rc-1
- v2.0.0-beta-1
- v2.0.0-beta
- v1.5.1
- v1.5.0
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-rc1
- v0.42.0
- v0.41.1
- v0.41.0
- v0.39.6
- v0.39.5
- v0.39.4
- v0.39.3
- v0.39.2
- v0.39.1
- v0.39.0
- v0.38.0
- v0.37.1
- v0.37.0
- v0.36.0
- v0.35.2
- v0.35.1
- v0.35.0
- v0.34.0
- v0.33.1
- v0.33.0
- v0.32.0
- v0.31.3
- v0.31.2
- v0.31.1
- v0.31.0
- v0.30.1
- v0.30.0
- v0.29.0
- v0.28.3
- v0.28.2
- v0.28.1
- v0.28.0
- v0.27.6
- v0.27.5
- v0.27.4
- v0.27.3
- v0.27.2
- v0.27.1
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.1
- v0.24.0
- v0.23.0
- v0.22.2
- v0.22.1
- v0.22.0
- v0.21.0
- v0.20.1
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.1
- v0.18.0
- v0.17.0
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.0
- v0.10.0
- v0.9.0
- v0.8.6
- v0.8.5
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.9
- v0.7.8
- v0.7.7
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.2
- v0.6.1
- v0.6.0
- v0.6.0-alpha.6
Drash
A REST microframework for Deno’s HTTP server with zero dependencies.
Table of Contents
- Quick Start
- Create Drash App
- Documentation
- Features
- Why use Drash?
- Mirrors
- Articles
- Benchmarks
- Contributing
- License
Quick Start
// File: app.ts
import { Drash } from "https://deno.land/x/drash@v1.x/mod.ts";
class HomeResource extends Drash.Http.Resource {
static paths = ["/"];
public GET() {
this.response.body = "Hello World! deno + Drash is cool!";
return this.response;
}
}
const server = new Drash.Http.Server({
response_output: "text/html",
resources: [HomeResource]
});
server.run({
hostname: "localhost",
port: 1447
});
console.log("Server listening: http://localhost:1447");
$ deno run --allow-net app.ts
Server listening: http://localhost:1447
$ curl localhost:1447
Hello World! deno + Drash is cool!
Create Drash App
Drash provides a basic tool to help you quickly create a Drash skeleton, with everything working out of the box, ready for you to build something great with.
This tool does not require you to install any Drash scripts or modules. It will create the skeleton of your choice (an API, a full web app, or a full web app with Vue) inside your current working directory.
To get started with the Create Drash App tool, see the following commands:
$ mkdir my-drash-project
$ cd my-drash-project
To make an API:
$ deno run --allow-run --allow-read --allow-write --allow-net https://deno.land/x/drash/create_app.ts --api
To make a web app:
$ deno run --allow-run --allow-read --allow-write --allow-net https://deno.land/x/drash/create_app.ts --web-app
To make a web app with Vue:
$ deno run --allow-run --allow-read --allow-write --allow-net https://deno.land/x/drash/create_app.ts --web-app --with-vue
Display the options with --help
:
$ deno run --allow-run --allow-read https://deno.land/x/drash/create_app.ts --help
Documentation
Features
- Content Negotiation
- Static Path Routing
- Regex Path Routing
- Middleware
- Drash Approved Middleware
- Body Handling: application/json
- Body Handling: application/x-www-form-urlencoded
- Body Handling: multipart/form-data
- Handling Path Params
- Handling URL Query Params
- Console Logging
- File Logging
Why Use Drash?
Drash is designed to help you build your projects quickly with the ability to scale. You can build an API, a web app, an SPA (like the documentation pages), or even a static HTML site. How you use Drash is up to you, so it can be everything you need and nothing you don’t — like a DRASH tent.
Drash takes concepts from the following:
- Flask — being micro and extensible
- Laravel — use of similarly styled middleware
- Tonic — use of resources
- RESTful principles — content negotiation, HTTP verbs, URIs, etc.
Thrown into the mix is Drash’s own concepts such as:
- Documentation-driven development
- Test-driven development
- Lowering barriers to usage
Drash does not force you to use all of its code. You can pick and choose which data members you want/need and use them however you deem fit. For example, Drash comes with a console logger and a file logger. If you only want these, then you only import these into your non-Drash project. How you use it is really up to you.
Mirrors
Articles
Benchmarks
Check out our benchmarks here.
Contributing
Contributors are welcomed!
Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.
License
By contributing your code, you agree to license your contribution under the MIT License.