Skip to content

Commit 486492c

Browse files
authored
chore(release): v0.12.0 (#224)
1 parent a92db52 commit 486492c

File tree

14 files changed

+12
-99
lines changed

14 files changed

+12
-99
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2018 Jeremy Daly
3+
Copyright (c) 2017-2023 Jeremy Daly
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

index.js

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
'use strict';
22

3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @version 0.11.0
7-
* @license MIT
8-
*/
9-
10-
const REQUEST = require('./lib/request'); // Resquest object
11-
const RESPONSE = require('./lib/response'); // Response object
12-
const UTILS = require('./lib/utils'); // Require utils library
13-
const LOGGER = require('./lib/logger'); // Require logger library
14-
const prettyPrint = require('./lib/prettyPrint'); // Pretty print for debugging
15-
const { ConfigurationError } = require('./lib/errors'); // Require custom errors
16-
17-
// Create the API class
3+
const REQUEST = require('./lib/request');
4+
const RESPONSE = require('./lib/response');
5+
const UTILS = require('./lib/utils');
6+
const LOGGER = require('./lib/logger');
7+
const prettyPrint = require('./lib/prettyPrint');
8+
const { ConfigurationError } = require('./lib/errors');
9+
1810
class API {
19-
// Create the constructor function.
2011
constructor(props) {
21-
// Set the version and base paths
2212
this._version = props && props.version ? props.version : 'v1';
2313
this._base =
2414
props && props.base && typeof props.base === 'string'
@@ -51,16 +41,12 @@ class API {
5141
? props.compression
5242
: false;
5343

54-
// Set sampling info
5544
this._sampleCounts = {};
5645

57-
// Init request counter
5846
this._requestCount = 0;
5947

60-
// Track init date/time
6148
this._initTime = Date.now();
6249

63-
// Logging levels
6450
this._logLevels = {
6551
trace: 10,
6652
debug: 20,
@@ -70,13 +56,11 @@ class API {
7056
fatal: 60,
7157
};
7258

73-
// Configure logger
7459
this._logger = LOGGER.config(props && props.logger, this._logLevels);
7560

7661
// Prefix stack w/ base
7762
this._prefix = this.parseRoute(this._base);
7863

79-
// Stores route mappings
8064
this._routes = {};
8165

8266
// Init callback
@@ -94,7 +78,6 @@ class API {
9478
// Global error status (used for response parsing errors)
9579
this._errorStatus = 500;
9680

97-
// Methods
9881
this._methods = [
9982
'get',
10083
'post',
@@ -110,7 +93,7 @@ class API {
11093
this._methods.forEach((m) => {
11194
this[m] = (...a) => this.METHOD(m.toUpperCase(), ...a);
11295
});
113-
} // end constructor
96+
}
11497

11598
// METHOD: Adds method, middleware, and handlers to routes
11699
METHOD(method, ...args) {

lib/compression.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
const zlib = require('zlib');
103

114
const defaultEnabledEcodings = ['gzip', 'deflate'];

lib/errors.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
// Custom error types
103

114
class RouteError extends Error {

lib/logger.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
// IDEA: add unique function identifier
103
// IDEA: response length
114
// https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference

lib/mimemap.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
// Minimal mime map for common file types
103

114
module.exports = {

lib/prettyPrint.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
module.exports = (routes) => {
103
let out = '';
114

lib/request.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
const QS = require('querystring'); // Require the querystring library
103
const UTILS = require('./utils'); // Require utils library
114
const LOGGER = require('./logger'); // Require logger library

lib/response.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
const UTILS = require('./utils.js');
103

114
const fs = require('fs'); // Require Node.js file system

lib/s3-service.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
'use strict';
2-
3-
/**
4-
* Lightweight web framework for your serverless applications
5-
* @author Jeremy Daly <jeremy@jeremydaly.com>
6-
* @license MIT
7-
*/
8-
92
// Require AWS SDK
103
const AWS = require('aws-sdk'); // AWS SDK
114

0 commit comments

Comments
 (0)