@flyio/fly
Basic engine running fly.io edge apps
Last updated 2 years ago by mrkurt .
ISC · Original npm · Tarball · package.json
$ cnpm install @flyio/fly 
SYNC missed versions from official npm registry.

Fly

Basic engine running fly.io edge apps

Installation

npm install -g @flyio/fly

Usage

Hello World!

Write javascript code to a file (index.js):

// index.js

addEventListener("fetch", async (event) => {
  const res = new Response("Hello! We support whirled peas.", { status: 200 })
  event.respondWith(res)
})

Start the fly server:

fly server

Visit your app:

open http://localhost:3000

Configuration

By default, fly will read your a .fly.yml file in your current working directory.

app:
  id: my-app-id
  settings:
    foo: bar

port: 4000 # defaults to 3000
log_level: debug
env: development

App configuration

Located in app in your .fly.yml file.

  • id - the fly.io app id, can be ommitted, useful for deployment purposes
  • settings - arbitrary settings for your applications, accessible in your code via the global variable appSettings

Server configuration

Located at the root level of the .fly.yml file.

  • port - is either a number or a string, it can refer to unix socket (default: 3000)
  • log_level - is how much logs we'll show you, can be info, debug, warn, error (default: debug in development, info everywhere else)
  • env - current deployment environment: development, test or production (default: development)

Environment overrides

  • port can be overriden by the environment variables FLY_PORT or PORT in that order
  • log_level will also lookup FLY_LOG_LEVEL or LOG_LEVEL
  • env will check FLY_ENV and then NODE_ENV

Current Tags

  • 0.3.1                                ...           latest (2 years ago)

20 Versions

  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.9                                ...           2 years ago
  • 0.2.8                                ...           2 years ago
  • 0.2.7                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 22
Dependencies (32)
Dev Dependencies (21)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |