GithubHelp home page GithubHelp logo

gabrielgrover / deno-drash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drashland/drash

0.0 1.0 0.0 6.87 MB

A REST microframework for Deno's HTTP server with zero dependencies.

Home Page: https://drash.land/

License: MIT License

TypeScript 99.23% HTML 0.41% CSS 0.01% JavaScript 0.21% Vue 0.13%

deno-drash's Introduction

Drash logo

Drash

A REST microframework for Deno's HTTP server with zero dependencies.


Table of Contents

Quick Start

// File: app.ts

import { Drash } from "https://deno.land/x/[email protected]/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

Full Documentation

Lifecycle Diagram

Features

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:

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.