up

package module
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 9 Imported by: 60

README

Up deploys infinitely scalable serverless apps, APIs, and static websites in seconds, so you can get back to working on what makes your product unique.

With Up there's no need to worry about managing or scaling machines, paying for idle servers, worrying about logging infrastructure or alerting. Just deploy your app with $ up and you're done!

Use the free OSS version, or subscribe to Up Pro for a small monthly fee for unlimited use within your company, there is no additional cost per team-member or application. Deploy dozens or even hundreds of applications for pennies thanks to AWS Lambda's cost effective nature.

About

Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.

Up currently supports Node.js, Golang, Python, Java, Crystal, Clojure and static sites out of the box. Up is platform-agnostic, supporting AWS Lambda and API Gateway as the first targets. You can think of Up as self-hosted Heroku style user experience for a fraction of the price, with the security, isolation, flexibility, and scalability of AWS.

Check out the documentation for more instructions and links, or try one of the examples, or chat with us in Slack.

OSS Features

Features of the free open-source edition.

Open source edition features

Pro Features

Up Pro provides additional features for production-ready applications such as encrypted environment variables, error alerting, unlimited team members, unlimited applications, priority email support, and global deployments for $19.99/mo USD. Visit Subscribing to Up Pro to get started.

Pro edition features

Quick Start

Install Up:

$ curl -sf https://up.apex.sh/install | sh

Create an app.js file:

require('http').createServer((req, res) => {
  res.end('Hello World\n')
}).listen(process.env.PORT)

Deploy the app:

$ up

Open it in the browser, or copy the url to your clipboard:

$ up url -o
$ up url -c

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MustParseConfigString = config.MustParseConfigString

MustParseConfigString returns config from JSON string.

View Source
var ParseConfigString = config.ParseConfigString

ParseConfigString returns config from JSON string.

View Source
var ReadConfig = config.ReadConfig

ReadConfig reads the configuration from `path`.

Functions

This section is empty.

Types

type Config

type Config = config.Config

Config for a project.

type Deploy

type Deploy struct {
	Stage  string
	Commit string
	Author string
	Build  bool
}

Deploy config.

type Domain

type Domain struct {
	Name      string
	Available bool
	Expiry    time.Time
	AutoRenew bool
}

Domain is a domain name and its availability.

type DomainContact

type DomainContact struct {
	Email            string
	FirstName        string
	LastName         string
	CountryCode      string
	City             string
	Address          string
	OrganizationName string
	PhoneNumber      string
	State            string
	ZipCode          string
}

DomainContact is the domain name contact information required for registration.

type Domains

type Domains interface {
	Availability(domain string) (*Domain, error)
	Suggestions(domain string) ([]*Domain, error)
	Purchase(domain string, contact DomainContact) error
	List() ([]*Domain, error)
}

Domains is the interface for purchasing and managing domains names.

type Logs

type Logs interface {
	io.Reader
}

Logs is the interface for viewing platform logs.

type LogsConfig

type LogsConfig struct {
	// Region is the target region.
	Region string

	// Query is the filter pattern.
	Query string

	// Since is used as the starting point when filtering
	// historical logs, no logs before this point are returned.
	Since time.Time

	// Follow is used to stream new logs.
	Follow bool

	// Expand is used to expand logs to a verbose format.
	Expand bool

	// OutputJSON is used to output raw json.
	OutputJSON bool
}

LogsConfig is configuration for viewing logs.

type Platform

type Platform interface {
	// Build the project.
	Build() error

	// Deploy to the given stage, to the
	// region(s) configured by the user.
	Deploy(Deploy) error

	// Logs returns an interface for working
	// with logging data.
	Logs(LogsConfig) Logs

	// Domains returns an interface for
	// managing domain names.
	Domains() Domains

	// URL returns the endpoint for the given
	// region and stage combination, or an
	// empty string.
	URL(region, stage string) (string, error)

	// Exists returns true if the application has been created.
	Exists(region string) (bool, error)

	CreateStack(region, version string) error
	DeleteStack(region string, wait bool) error
	ShowStack(region string) error
	PlanStack(region string) error
	ApplyStack(region string) error

	ShowMetrics(region, stage string, start time.Time) error
}

Platform is the interface for platform integration, defining the basic set of functionality required for Up applications.

type Project

type Project struct {
	Platform
	// contains filtered or unexported fields
}

Project manager.

func New

func New(c *Config, events event.Events) *Project

New project.

func (*Project) ApplyStack

func (p *Project) ApplyStack(region string) error

ApplyStack implementation.

func (*Project) Build

func (p *Project) Build(hooks bool) error

Build the project.

func (*Project) CreateStack

func (p *Project) CreateStack(region, version string) error

CreateStack implementation.

func (*Project) DeleteStack

func (p *Project) DeleteStack(region string, wait bool) error

DeleteStack implementation.

func (*Project) Deploy

func (p *Project) Deploy(d Deploy) error

Deploy the project.

func (*Project) Init

func (p *Project) Init(stage string) error

Init initializes the runtime such as remote environment variables.

func (*Project) PlanStack

func (p *Project) PlanStack(region string) error

PlanStack implementation.

func (*Project) Prune

func (p *Project) Prune(region, stage string, versions int) error

Prune implementation.

func (*Project) RunHook

func (p *Project) RunHook(name string) error

RunHook runs a hook by name.

func (*Project) RunHooks

func (p *Project) RunHooks(names ...string) error

RunHooks runs hooks by name.

func (*Project) ShowMetrics

func (p *Project) ShowMetrics(region, stage string, start time.Time) error

ShowMetrics implementation.

func (*Project) ShowStack

func (p *Project) ShowStack(region string) error

ShowStack implementation.

func (*Project) WithPlatform

func (p *Project) WithPlatform(platform Platform) *Project

WithPlatform to `platform`.

func (*Project) Zip

func (p *Project) Zip() (io.Reader, error)

Zip returns the zip if supported by the platform.

type Pruner

type Pruner interface {
	Prune(region, stage string, versions int) error
}

Pruner is the interface used to prune old versions and the artifacts associated such as S3 zip files for Lambda.

type Runtime

type Runtime interface {
	Init(stage string) error
}

Runtime is the interface used by a platform to support runtime operations such as initializing environment variables from remote storage.

type Zipper

type Zipper interface {
	Zip() io.Reader
}

Zipper is the interface used by platforms which utilize zips for delivery of deployments.

Directories

Path Synopsis
cmd
up
Package config provides configuration structures, validation, and defaulting for up.json config.
Package config provides configuration structures, validation, and defaulting for up.json config.
Package handler provides what is essentially the core of Up's reverse proxy, complete with all middleware for handling logging, redirectcs, static file serving and so on.
Package handler provides what is essentially the core of Up's reverse proxy, complete with all middleware for handling logging, redirectcs, static file serving and so on.
http
cors
Package cors provides CORS support.
Package cors provides CORS support.
errorpages
Package errorpages provides default and customizable error pages, via error.html, 5xx.html, or 500.html for example.
Package errorpages provides default and customizable error pages, via error.html, 5xx.html, or 500.html for example.
gzip
Package gzip provides gzip compression support.
Package gzip provides gzip compression support.
headers
Package headers provides header injection support.
Package headers provides header injection support.
inject
Package inject provides script and style injection.
Package inject provides script and style injection.
logs
Package logs provides HTTP request and response logging.
Package logs provides HTTP request and response logging.
poweredby
Package poweredby provides nothing :).
Package poweredby provides nothing :).
redirects
Package redirects provides redirection and URL rewriting.
Package redirects provides redirection and URL rewriting.
relay
Package relay provides a reverse proxy which relays requests to your "vanilla" HTTP server, and supports crash recovery.
Package relay provides a reverse proxy which relays requests to your "vanilla" HTTP server, and supports crash recovery.
robots
Package robots provides a way of dealing with robots exclusion protocol
Package robots provides a way of dealing with robots exclusion protocol
static
Package static provides static file serving with HTTP cache support.
Package static provides static file serving with HTTP cache support.
internal
colors
Package colors provides colors used by the CLI.
Package colors provides colors used by the CLI.
errorpage
Package errorpage provides error page loading utilities.
Package errorpage provides error page loading utilities.
header
Package header provides path-matched header injection rules.
Package header provides path-matched header injection rules.
inject
Package inject provides script and style injection utilities.
Package inject provides script and style injection utilities.
logs
Package logs provides logging utilities.
Package logs provides logging utilities.
logs/parser
Package parser provides a parser for Up's log query language, abstracting away provider specifics.
Package parser provides a parser for Up's log query language, abstracting away provider specifics.
logs/parser/ast
Package ast provides the log query language abstract syntax tree.
Package ast provides the log query language abstract syntax tree.
logs/text
Package text implements a development-friendly textual handler.
Package text implements a development-friendly textual handler.
logs/writer
Package writer provides an io.Writer for capturing process output as logs, so that stdout may become INFO, and stderr ERROR.
Package writer provides an io.Writer for capturing process output as logs, so that stdout may become INFO, and stderr ERROR.
metrics
Package metrics provides higher level CloudWatch metrics operations.
Package metrics provides higher level CloudWatch metrics operations.
progressreader
Package progressreader provides an io.Reader progress bar.
Package progressreader provides an io.Reader progress bar.
proxy
Package proxy provides API Gateway and Lambda interoperability.
Package proxy provides API Gateway and Lambda interoperability.
redirect
Package redirect provides compiling and matching redirect and rewrite rules.
Package redirect provides compiling and matching redirect and rewrite rules.
setup
Package setup provides up.json initialization.
Package setup provides up.json initialization.
shim
Package shim provides a shim for running arbitrary languages on Lambda.
Package shim provides a shim for running arbitrary languages on Lambda.
stats
Package stats provides CLI analytics.
Package stats provides CLI analytics.
userconfig
Package userconfig provides user machine-level configuration.
Package userconfig provides user machine-level configuration.
util
Package util haters gonna hate.
Package util haters gonna hate.
validate
Package validate provides config validation functions.
Package validate provides config validation functions.
zip
platform
aws/cost
Package cost provides utilities for calculating AWS Lambda pricing.
Package cost provides utilities for calculating AWS Lambda pricing.
aws/domains
Package domains provides domain management for AWS platforms.
Package domains provides domain management for AWS platforms.
aws/logs
Package logs provides log management for AWS platforms.
Package logs provides log management for AWS platforms.
aws/regions
Package regions provides AWS region utilities.
Package regions provides AWS region utilities.
event
Package event provides an evented mechanism for hooking into platform specifics.
Package event provides an evented mechanism for hooking into platform specifics.
lambda
Package lambda implements the API Gateway & AWS Lambda platform.
Package lambda implements the API Gateway & AWS Lambda platform.
lambda/stack
Package stack provides CloudFormation stack support.
Package stack provides CloudFormation stack support.
discard
Package discard provides a reporter for discarding events.
Package discard provides a reporter for discarding events.
plain
Package plain provides plain-text reporting for CI.
Package plain provides plain-text reporting for CI.
text
Package text provides a reporter for humanized interactive events.
Package text provides a reporter for humanized interactive events.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL