Skip to content

Instantly share code, notes, and snippets.

View msfidelis's full-sized avatar
🐳
Ship!

Matheus Fidelis msfidelis

🐳
Ship!
View GitHub Profile
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...
service: example-app-001
provider:
name: aws
vpc:
securityGroupIds:
- sg-09890c1667f406g748
subnetIds:
- subnet-0289c494949443e01
- subnet-95895895895893e02
version: "3"
services:
sqs:
image: s12v/elasticmq:latest
ports:
- "9324:9324"
networks:
- developer
dynamo:
FROM node:8.10.0-alpine
RUN npm install -g serverless
WORKDIR /app/
COPY ./package.json /app/package.json
RUN npm install
{
"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": "",
'use strict';
const config = require('config');
module.exports = app => {
app.get('/version', (req, res) => {
const infos = {
version: config.get('VERSION'),
env: config.get('ENV')
{
"SECRET": "THECAKEISALIE",
"VERSION": "1.0.0",
"ENV": "Development"
}
{
"SECRET": "DOUTOREQUEMTEMDOUTORADO",
"VERSION": "1.0.0",
"ENV": "Production"
}
service: express-serverless-app
provider:
name: aws
runtime: nodejs8.10
stage: v1
region: us-east-1
timeout: 30
memorySize: 512
package:
'use strict';
const app = require('./app');
const serverless = require('serverless-http')
module.exports.run = serverless(app);