Coder Social home page Coder Social logo

heroku-buildpack-dart's Introduction

Heroku Buildpack: Dart

This is a Heroku buildpack for Dart.

(Note: This buildpack requires that you use the Cedar-14 (Ubuntu 14.x-based) stack for your Heroku application. This is now the default stack on Heroku.)

Features

  • Runs Dart VM as a server in Heroku's cloud
  • Installs packages with pub
  • Builds the client app with pub build

Getting Started

(These instructions assume you have the heroku tools and git installed, and that you have a heroku account.)

Create a Heroku app, and specify both this buildpack and a URL that points to a compiled Dart SDK.

Here is a set of commands that deploys a minimal HTTP server built with Dart to Heroku:

$> git clone https://github.com/igrigorik/heroku-buildpack-dart.git
$> mkdir myfirstdartappforheroku
$> cp -R heroku-buildpack-dart/test-app/* myfirstdartappforheroku
$> cd myfirstdartappforheroku
$> git init
$> git add -A .
$> git commit -am "first commit"
$> heroku create myfirstdartappforheroku
$> heroku config:set DART_SDK_URL=<archive url>
$> heroku config:add BUILDPACK_URL=https://github.com/igrigorik/heroku-buildpack-dart.git

Push the app to Heroku. Learn more about deploying to Heroku with git.

$> git push heroku master

You may need to scale to one web dyno (aka server):

$> heroku ps:scale web=1

Test your app! The URL is printed at the end of the git push step.

Configuration

Location of Dart SDK

You must specify a URL that points to a .zip that contains the Dart SDK. Links to Dart SDKs built for Linux are available.

$> heroku config:set DART_SDK_URL=<archive url>

Specifying the script

The Procfile defines the file to run when the application starts. We recommend to put the server script into your application's bin/ directory.

The sample app's Procfile looks like:

web: ./dart-sdk/bin/dart bin/basic_http_server.dart

Overriding the build command

By default pub build is launched after pub get, it can be useful to use another command: for instance pub build --mode=debug or /app/dart-sdk/bin/dart build.dart:

$> heroku config:set DART_BUILD_CMD="/app/dart-sdk/bin/dart build.dart"

Activating global packages

You can activate global packages by providing the environment variable DART_GLOBAL_PACKAGES. Each globally activated package is space delimited and takes the form of [email protected]:

$> heroku config:set DART_GLOBAL_PACKAGES="[email protected]"

Example

See test-app directory for the world simplest Dart web app running on Heroku.

Learning more

Dart VM can access files, directories, sockets, HTTP, web sockets, SSL, and more. See the dart:io library for core functionality.

Dart's package repository, pub, hosts lots of options for more functionality, such as database drivers, HTTP server frameworks, templates, and more.

License

The MIT License - Copyright (c) 2012 Ilya Grigorik

heroku-buildpack-dart's People

Contributors

adam-singer avatar alexpaluzzi avatar devoncarew avatar eee-c avatar ggirou avatar igrigorik avatar joeconwaystk avatar nfrancois avatar selkhateeb avatar sethladd avatar tomykaira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.