Skip to content

Commit 85b32a7

Browse files
committed
fix: change name to tencent-serverless-http
1 parent 81b3ee9 commit 85b32a7

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## [1.0.1](https://github.com/yugasun/tencent-serverless-nodejs/compare/v1.0.0...v1.0.1) (2020-01-15)
1+
## [1.0.1](https://github.com/yugasun/tencent-serverless-http/compare/v1.0.0...v1.0.1) (2020-01-15)
22

33

44
### Bug Fixes
55

6-
* update readme ([bc3491e](https://github.com/yugasun/tencent-serverless-nodejs/commit/bc3491e))
6+
* update readme ([bc3491e](https://github.com/yugasun/tencent-serverless-http/commit/bc3491e))

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Tencent Serverless Nodejs
22

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)
3+
[![Build Status](https://travis-ci.com/yugasun/tencent-serverless-http.svg?branch=master)](https://travis-ci.com/yugasun/tencent-serverless-http)
4+
[![npm](https://img.shields.io/npm/v/tencent-serverless-http.svg)]()
5+
[![npm](https://img.shields.io/npm/dm/tencent-serverless-http.svg)]()
6+
[![dependencies Status](https://david-dm.org/yugasun/tencent-serverless-http/status.svg)](https://david-dm.org/yugasun/tencent-serverless-http)
77

88
This project is a fork of
99
[aws-serverless-express](https://github.com/awslabs/aws-serverless-express.git),
@@ -12,15 +12,15 @@ and modify for tencent cloud scf.
1212
## Install
1313

1414
```bash
15-
npm install tencent-serverless-nodejs
15+
npm install tencent-serverless-http
1616
```
1717

1818
## Usage
1919

2020
```js
2121
// handler.js
2222
'use strict';
23-
const tencentServerlessNodejs = require('tencent-serverless-nodejs');
23+
const tencentServerlessNodejs = require('tencent-serverless-http');
2424
const app = require('./app');
2525
const server = tencentServerlessNodejs.createServer(app);
2626

@@ -33,7 +33,7 @@ This package includes middleware to easily get the event object Lambda receives
3333
from API Gateway
3434

3535
```js
36-
const tencentServerlessNodejsMiddleware = require('tencent-serverless-nodejs/middleware');
36+
const tencentServerlessNodejsMiddleware = require('tencent-serverless-http/middleware');
3737
app.use(tencentServerlessNodejsMiddleware.eventContext());
3838
app.get('/', (req, res) => {
3939
res.json(req.apiGateway.event);

SCOPE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ directory which allows developers to quickly deploy a running application using
1616

1717
This repository should contain:
1818

19-
- The tencent-serverless-nodejs library.
20-
- Documentation on using tencent-serverless-nodejs
21-
- Examples of using the tencent-serverless-nodejs library.
19+
- The tencent-serverless-http library.
20+
- Documentation on using tencent-serverless-http
21+
- Examples of using the tencent-serverless-http library.
2222

2323
This repository does not contain:
2424

examples/basic-starter/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const express = require('express')
44
const bodyParser = require('body-parser')
55
const cors = require('cors')
66
const compression = require('compression')
7-
const tencentServerlessNodejsMiddleware = require('tencent-serverless-nodejs/middleware')
7+
const tencentServerlessNodejsMiddleware = require('tencent-serverless-http/middleware')
88
const app = express()
99
const router = express.Router()
1010

1111
app.set('view engine', 'pug')
1212

1313
if (process.env.NODE_ENV === 'test') {
14-
// NOTE: tencent-serverless-nodejs uses this app for its integration tests
14+
// NOTE: tencent-serverless-http uses this app for its integration tests
1515
// and only applies compression to the /sam endpoint during testing.
1616
router.use('/sam', compression())
1717
} else {
@@ -88,7 +88,7 @@ const users = [{
8888
}]
8989
let userIdCounter = users.length
9090

91-
// The tencent-serverless-nodejs library creates a server and listens on a Unix
91+
// The tencent-serverless-http library creates a server and listens on a Unix
9292
// Domain Socket for you, so you can remove the usual call to app.listen.
9393
// app.listen(3000)
9494
app.use('/', router)

examples/basic-starter/lambda.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict'
2-
const awsServerlessExpress = require(process.env.NODE_ENV === 'test' ? '../../index' : 'tencent-serverless-nodejs')
2+
const awsServerlessExpress = require(process.env.NODE_ENV === 'test' ? '../../index' : 'tencent-serverless-http')
33
const app = require('./app')
44

55
// NOTE: If you get ERR_CONTENT_DECODING_FAILED in your browser, this is likely
66
// due to a compressed response (e.g. gzip) which has not been handled correctly
7-
// by tencent-serverless-nodejs and/or API Gateway. Add the necessary MIME types to
7+
// by tencent-serverless-http and/or API Gateway. Add the necessary MIME types to
88
// binaryMimeTypes below, then redeploy (`npm run package-deploy`)
99
const binaryMimeTypes = [
1010
'application/javascript',

examples/basic-starter/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"license": "Apache-2.0",
1717
"dependencies": {
18-
"tencent-serverless-nodejs": "^1.0.0",
18+
"tencent-serverless-http": "^1.0.0",
1919
"body-parser": "^1.17.1",
2020
"compression": "^1.6.2",
2121
"cors": "^2.8.3",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "tencent-serverless-nodejs",
3-
"version": "1.0.1",
2+
"name": "tencent-serverless-http",
3+
"version": "1.0.2",
44
"description": "This library enables you to utilize Tencent Cloud API Gateway to respond to web and API requests using your existing Node.js application framework.",
55
"keywords": [
66
"tencent-cloud",
@@ -10,9 +10,9 @@
1010
"scf",
1111
"nodejs"
1212
],
13-
"homepage": "https://github.com/yugasun/tencent-serverless-nodejs",
13+
"homepage": "https://github.com/yugasun/tencent-serverless-http",
1414
"bugs": {
15-
"url": "https://github.com/yugasun/tencent-serverless-nodejs/issues"
15+
"url": "https://github.com/yugasun/tencent-serverless-http/issues"
1616
},
1717
"license": "Apache-2.0",
1818
"files": [
@@ -23,7 +23,7 @@
2323
"main": "index.js",
2424
"repository": {
2525
"type": "git",
26-
"url": "https://github.com/yugasun/tencent-serverless-nodejs.git"
26+
"url": "https://github.com/yugasun/tencent-serverless-http.git"
2727
},
2828
"engines": {
2929
"node": ">=6"

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function forwardResponseToApiGateway (server, response, resolver) {
9999
}
100100

101101
function forwardConnectionErrorResponseToApiGateway (error, resolver) {
102-
console.log('ERROR: tencent-serverless-nodejs connection error')
102+
console.log('ERROR: tencent-serverless-http connection error')
103103
console.error(error)
104104
const errorResponse = {
105105
statusCode: 502, // "DNS resolution, TCP level errors, or actual HTTP parse errors" - https://nodejs.org/api/http.html#http_http_request_options_callback
@@ -111,7 +111,7 @@ function forwardConnectionErrorResponseToApiGateway (error, resolver) {
111111
}
112112

113113
function forwardLibraryErrorResponseToApiGateway (error, resolver) {
114-
console.log('ERROR: tencent-serverless-nodejs error')
114+
console.log('ERROR: tencent-serverless-http error')
115115
console.error(error)
116116
const errorResponse = {
117117
statusCode: 500,
@@ -174,7 +174,7 @@ function createServer (requestListener, serverListenCallback, binaryTypes) {
174174
.on('error', (error) => {
175175
/* istanbul ignore else */
176176
if (error.code === 'EADDRINUSE') {
177-
console.warn(`WARNING: Attempting to listen on socket ${getSocketPath(server._socketPathSuffix)}, but it is already in use. This is likely as a result of a previous invocation error or timeout. Check the logs for the invocation(s) immediately prior to this for root cause, and consider increasing the timeout and/or cpu/memory allocation if this is purely as a result of a timeout. tencent-serverless-nodejs will restart the Node.js server listening on a new port and continue with this request.`)
177+
console.warn(`WARNING: Attempting to listen on socket ${getSocketPath(server._socketPathSuffix)}, but it is already in use. This is likely as a result of a previous invocation error or timeout. Check the logs for the invocation(s) immediately prior to this for root cause, and consider increasing the timeout and/or cpu/memory allocation if this is purely as a result of a timeout. tencent-serverless-http will restart the Node.js server listening on a new port and continue with this request.`)
178178
server._socketPathSuffix = getRandomString()
179179
return server.close(() => startServer(server))
180180
} else {

0 commit comments

Comments
 (0)