当前位置: 首页 > 软件库 > 云计算 > Serverless 系统 >

dawson-cli

授权协议 GPL-3.0 License
开发语言 JavaScript
所属分类 云计算、 Serverless 系统
软件类型 开源软件
地区 不详
投 递 者 子车桐
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

dawson

----

Sorry, this project is not maintained anymore.

----

dawson is a serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda).
You can use dawson to build and deploy backend code and infrastructure for single-page apps + API, pure APIs or server-rendered pages.

npm package

// api.js

import pug from 'pug';
const template = pug.compileFile('template.pug');

export async function greet (event) {
    const name = event.params.path.name
    const age = await getUserAge(name);
    return template({ name, age });
}
greet.api = {
    path: 'greet/{name}'
}
$ npm install -g @dawson/dawson-cli
$ export AWS_REGION=... AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
$ dawson deploy

Documentation

Getting Started Guide, API & CLI Documentation

Examples

Examples & Reference Apps

Articles & Tutorials

  1. dawson & React server-side rendering by @hwclass

About

dawson lets you to deploy your serverless Node.js apps on Amazon Web Services. It requires no boilerplate, no init command and no configuration files. Just write your functions and deploy!

You can write your functions using the latest JavaScript version (babel-preset-latest), including async-await, object-rest-spread etc. Functions can be async and can return Promises. There's also built-in authorization support via API Gateway Custom Authorizers.

Each function has its own IAM Execution Role, so you can define fine-graned IAM Policies.
dawson offers first-class support for Single Page Applications: a CloudFront Distribution will be deployed in front of your app, correctly mapping assets and the API origin, so you don't have to worry about CORS. An AWS WAF WebACL can also be attached to CloudFront.

dawson does not bundle your app with webpack, browserify or rollup, so you'll never have to deal with weird things. Your app's devDependencies are stripped out while deploying, keeping the bundle ZIP small.

dawson uses pure CloudFormation templates, following the infrastructure-as-code principle; it requires no local or remote state files which may go out-of-sync or mistakenly be deleted. You can customize your app's template in every part, e.g.: you can add CloudFormation Resources, modify Properties of Resources created by dawson etc. As a free benefit, you get out-of-the-box support for multiple stages and regions.

Finally, dawson will automatically support HTTPS for custom domains thanks to AWS ACM. Also, if you use Route53 your DNS Zone can be automatically updated.

CLI

Using the dawson command you can deploy the infrastructure, inspect logs (in real time, like tail -f) and spin up a full development server so you can run your all locally in an environment will be almost identical to production's. The development server can also run functions locally in response to real AWS Events (S3 Events, DynamoDB Triggers etc.).

$ dawson deploy # deploy your app
$ dawson log -f functionName --follow # get function logs
$ dawson describe # list CloudFormation outputs
$ dawson dev # start a development server

Architecture

https://raw.githubusercontent.com/dawson-org/dawson-cli/images/architecture.png

(additionally for each region you'll deploy to, dawson uses a support stack with an S3 Bucket to store Lambda ZIP bundles and CloudFormation templates)

Changelog

A changelog is maintained in the Releases page.

Contributing

Any contribution is very welcome! You may pick an Issue, fork and start working on that. Should you need any guidance or help please ask :)

Testing

Run npm test.


We are currently testing and targeting 100% coverage for functions that are involved in the template generation (src/factories/**.js).

Contributors

Thanks goes to these wonderful people (emoji key):


Simone Lusenti

�� �� �� �� �� �� �� �� �� �� ⚠️ ��

Alex Casalboni

�� �� �� �� �� ⚠️ ��

Giacomo Consonni

�� �� ��

Luca Casartelli

�� ��

Chris Matheson

�� ��

Robert Kistner

�� ��

This project follows the all-contributors specification. Contributions of any kind welcome!

Support

In case you have an issue, make sure you have updated to the latest version (e.g.: npm i @dawson/dawson-cli@latest), then:

  • search / post on StackOverflow using the dawson tag
  • search / open an issue in this repo
  • contact me on Twitter @Lanzone31

Related

License

Copyright (C) 2016  Simone Lusenti

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 相关资料
  • 问题内容: 我经常不得不调试编写的Java代码,以便有一个接口和该接口的一个实现。 例如,将有一个接口Foo,其中有一个名为FooImpl的实现。在下面的代码中,如果我按住ctrl键单击doThings,则当我实际要转到FooImpl.java来查看实现时,它将跳至Foo.java。 当我结束界面时,必须使用ctrl-shift-r打开FooImpl。如果我可以按一下ctrl- alt并单击doT

  • 问题内容: 首先,我不是要在这里发动战争。我非常了解Jersey,但是很少使用httpclient。 jersey-client和Apache的httpclient之间的主要区别是什么?在哪些方面比另一方面更好?哪里有比较好的图表?较大的文件(例如2048 MB)中,哪一个效果更好? 非常感谢您的评论! 问题答案: 这两件事可能不应该直接比较。Jersey是REST客户端,具有完整的JAX-RS实

  • 问题内容: 我的应用程序中有两个表。左表就像一个列表。单击左表将打开一个右表,其中包含基于我单击左表的字段的值。 现在的问题是,如果我在右表中编辑一个单元格,而不按Enter键并单击左表中的新项目,则所有表中的特定单元格都处于可编辑模式。以及所有表格的单元格值。 我该如何解决这个问题? 问题答案: 不能完全肯定,我明白你的感受VS你所期望的,但表的默认行为是有点出乎意料的是,当焦点转到表外的某个地

  • 问题内容: 如何使用google-api-java-client解析用户Google日历中事件的开始和结束时间? 从Google代码安装此示例android项目后,我可以进入Google日历并解析一些信息(例如所有日历,事件名称,发布时间和摘要),但是我无法终生获取事件的开始和结束时间。 我对代码的理解是这样的。 在主要活动类(CalendarAndroidSample.java)内,这是获取我每

  • 问题内容: 我正在为小型LibGDX驱动的游戏编写服务器端代码,偶然发现了一个问题。每次尝试使用任何方法时,都会遇到。 显然这是因为我没有实现ApplicationListener,所以LibGDX尚未初始化。 有没有办法以无头/ CLI方式初始化LibGDX?我需要能够在服务器端加载TiledMap对象。 com.esotericsoftware.kryonet.Server $ 1.recei

  • 问题内容: 我们正在尝试将声音集成到我们的一个项目中,我的团队成员没有收到此错误,而是在两台不同的机器上收到了此错误。 堆栈跟踪: 码: 我们从domainController调用此类 有谁知道如何解决此异常?我尝试重新安装编辑器软件(Eclipse),但无济于事。 预先感谢分配。 编辑 我们只是尝试切换声音文件。我们尝试使用较小的文件运行它。现在可以使用,但是一旦切换回较大的.wav文件(10