This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- echo Installing Node 8 | |
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
- apt-get install -y nodejs | |
- echo Entered the pre_build phase... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: example-app-001 | |
provider: | |
name: aws | |
vpc: | |
securityGroupIds: | |
- sg-09890c1667f406g748 | |
subnetIds: | |
- subnet-0289c494949443e01 | |
- subnet-95895895895893e02 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
sqs: | |
image: s12v/elasticmq:latest | |
ports: | |
- "9324:9324" | |
networks: | |
- developer | |
dynamo: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8.10.0-alpine | |
RUN npm install -g serverless | |
WORKDIR /app/ | |
COPY ./package.json /app/package.json | |
RUN npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "migrate-express-to-serverless", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"dev": "export NODE_ENV=dev && serverless offline start --skipCacheInvalidation" | |
}, | |
"keywords": [], | |
"author": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const config = require('config'); | |
module.exports = app => { | |
app.get('/version', (req, res) => { | |
const infos = { | |
version: config.get('VERSION'), | |
env: config.get('ENV') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SECRET": "THECAKEISALIE", | |
"VERSION": "1.0.0", | |
"ENV": "Development" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SECRET": "DOUTOREQUEMTEMDOUTORADO", | |
"VERSION": "1.0.0", | |
"ENV": "Production" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: express-serverless-app | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: v1 | |
region: us-east-1 | |
timeout: 30 | |
memorySize: 512 | |
package: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const app = require('./app'); | |
const serverless = require('serverless-http') | |
module.exports.run = serverless(app); |