Skip to content

Commit

Permalink
Merge pull request #9 from ppatt/master
Browse files Browse the repository at this point in the history
added python3.7 runtime
  • Loading branch information
alhazmy13 authored Mar 19, 2019
2 parents d2f9fe0 + bd607d4 commit 59e0b4d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To do so, it starts an HTTP server that handles the request's lifecycle like API

**Features:**

* Nodejs λ, Python 2.7, Python 3.6, and Ruby only.
* Nodejs λ, Python 2.7, Python 3.6, Python 3.7, and Ruby only.
* Velocity templates support.
* Lazy loading of your files with require cache invalidation: no need for a reloading tool like Nodemon.
* And more: integrations, authorizers, proxies, timeouts, responseParameters, HTTPS, Babel runtime, CORS, etc...
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,10 @@ class Offline {
const apiKeys = this.service.provider.apiKeys;
const protectedRoutes = [];

if (['nodejs', 'nodejs4.3', 'nodejs6.10', 'nodejs8.10', 'babel', 'python2.7', 'python3.6', 'ruby2.5'].indexOf(serviceRuntime) === -1) {
if (utils.supportedRuntimes.indexOf(serviceRuntime) === -1) {
this.printBlankLine();
this.serverlessLog(`Warning: found unsupported runtime '${serviceRuntime}'`);
this.serverlessLog(`Supported runtimes: ${utils.supportedRuntimes}`);

return;
}
Expand Down
13 changes: 12 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@ module.exports = {
// Detect the toString encoding from the request headers content-type
// enhance if further content types need to be non utf8 encoded.
detectEncoding: request => _.includes(request.headers['content-type'], 'multipart/form-data') ? 'binary' : 'utf8',
isProxyRuntime: runtime => { return runtime.startsWith('python') || runtime.startsWith('ruby') }
isProxyRuntime: runtime => { return runtime.startsWith('python') || runtime.startsWith('ruby') },
supportedRuntimes: [
'nodejs',
'nodejs4.3',
'nodejs6.10',
'nodejs8.10',
'babel',
'python2.7',
'python3.6',
'python3.7',
'ruby2.5',
],
};

0 comments on commit 59e0b4d

Please sign in to comment.