Skip to content

Commit 9130038

Browse files
committed
feat: update for tencent cloud
1 parent bc8746e commit 9130038

28 files changed

+17028
-0
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
extends: 'standard',
3+
globals: {
4+
test: true,
5+
expect: true,
6+
describe: true,
7+
jest: true
8+
}
9+
};

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Please ensure all pull requests are made against the `develop` branch.
2+
3+
*Issue #, if available:*
4+
5+
*Description of changes:*
6+
7+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
npm-debug.log
3+
.DS_Store
4+
.env
5+
coverage

.travis.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
language: node_js
2+
3+
node_js:
4+
- 6
5+
- 8
6+
# - node # runs tests against latest version of Node.js for future-proofing
7+
8+
before_install:
9+
- echo 'Installing example dependencies...'
10+
- npm run install-example-dependencies
11+
- echo 'Example dependencies installed!'
12+
13+
# NOTE: forcing Travis to use `npm install` instead of `npm ci`
14+
# which was removing our examples' node_modules
15+
install:
16+
- npm install
17+
18+
jobs:
19+
include:
20+
- stage: test
21+
script:
22+
- pwd
23+
- npm test
24+
- stage: lint
25+
script:
26+
- npm run lint
27+
- stage: deploy
28+
script: skip
29+
node_js: 8 # semantic-release requires Node >= 8.3
30+
# NOTE: Pull Request builds do not run deploy
31+
deploy:
32+
provider: script
33+
on:
34+
branch: master
35+
skip_cleanup: true
36+
script:
37+
- npm run release
38+
39+
cache:
40+
directories:
41+
- node_modules
42+
- examples/basic-starter/node_modules
43+
44+
notifications:
45+
email:
46+
on_failure: change

CHANGELOG.md

Whitespace-only changes.

NOTICE.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
AWS Serverless Express
2+
Copyright 2016-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Tencent Serverless Nodejs
2+
3+
[![Build Status](https://travis-ci.com/yugasun/tencent-serverless-nodejs.svg?branch=master)](https://travis-ci.com/yugasun/tencent-serverless-nodejs)
4+
[![npm](https://img.shields.io/npm/v/tencent-serverless-nodejs.svg)]()
5+
[![npm](https://img.shields.io/npm/dm/tencent-serverless-nodejs.svg)]()
6+
[![dependencies Status](https://david-dm.org/yugasun/tencent-serverless-nodejs/status.svg)](https://david-dm.org/yugasun/tencent-serverless-nodejs)
7+
8+
This project is a fork of
9+
[tencent-serverless-nodejs](https://github.com/yugasun/tencent-serverless-nodejs),
10+
and modify for tencent cloud scf.
11+
12+
## Getting Started
13+
14+
```bash
15+
npm install tencent-serverless-nodejs
16+
```
17+
18+
```js
19+
// handler.js
20+
'use strict';
21+
const tencentServerlessNodejs = require('tencent-serverless-nodejs');
22+
const app = require('./app');
23+
const server = tencentServerlessNodejs.createServer(app);
24+
25+
exports.handler = (event, context) => {
26+
tencentServerlessNodejs.proxy(server, event, context);
27+
};
28+
```
29+
30+
This package includes middleware to easily get the event object Lambda receives
31+
from API Gateway
32+
33+
```js
34+
const tencentServerlessNodejsMiddleware = require('tencent-serverless-nodejs/middleware');
35+
app.use(tencentServerlessNodejsMiddleware.eventContext());
36+
app.get('/', (req, res) => {
37+
res.json(req.apiGateway.event);
38+
});
39+
```

SCOPE.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
############################################################################
2+
## SCOPE.txt - version 1.0 ##
3+
## Created by Brett Andrews - andrbret@amazon.com ##
4+
## ---------------------------------------------------------------------- ##
5+
## Version history: ##
6+
## ---------------------------------------------------------------------- ##
7+
## v1.0 - 02/09/18 - Initial scope document ##
8+
############################################################################
9+
10+
# Objective
11+
12+
The goal of this library is to provide developers with a way to run Node.js
13+
HTTP applications and REST APIs (including but not limited to the usage of
14+
frameworks such as Express) on AWS Lambda. This repository includes an example
15+
directory which allows developers to quickly deploy a running application using SAM.
16+
17+
This repository should contain:
18+
19+
- The tencent-serverless-nodejs library.
20+
- Documentation on using tencent-serverless-nodejs
21+
- Examples of using the tencent-serverless-nodejs library.
22+
23+
This repository does not contain:
24+
25+
- Code that comprises a complete application.

0 commit comments

Comments
 (0)