Skip to content

Commit ef9fbcd

Browse files
committed
Add serverless
1 parent fe2f4a9 commit ef9fbcd

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# package directories
2+
node_modules
3+
jspm_packages
4+
5+
# Serverless directories
6+
.serverless

handler.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
module.exports.hello = (event, context, callback) => {
4+
const response = {
5+
statusCode: 200,
6+
headers: {
7+
'Access-Control-Allow-Origin': '*',
8+
'Content-Type': 'text/html; charset=utf-8',
9+
},
10+
body: `<html><head><title>Thomas Foricher</title><style>body,html,main{height:100%}.info,a{padding:20px;color:#000}.info,.links,a,a:visited{color:#000}body{margin:0;font-family:Roboto,sans-serif}main{padding:0;margin:0;display:flex;align-items:center;justify-content:center}.info{margin:20px;line-height:20px;text-align:center}.name{font-size:2em;font-weight:700}.links{font-size:1em}a{display:inline-block;vertical-align:middle;white-space:nowrap}a:hover{color:grey}</style><link href="http://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"></head><body><main><me><div class="info name">Thomas Foricher</div><div class="info links"><a target="_blank" href="https://twitter.com/codeKonami">Twitter</a><a target="_blank" href="https://www.linkedin.com/in/thomasforicher/">LinkedIn</a><a href="mailto:thomas.foricher@gmail.com">Email</a><a target="_blank" href="https://www.made-on-mars.com">Made On Mars</a><a target="_blank" href="http://codekonami.fr">Blog</a><a target="_blank" href="https://github.com/codeKonami">Github</a><a target="_blank" href="https://s3-eu-west-1.amazonaws.com/thomasforicher/Thomas_Foricher-resume.pdf#zoom=140">CV</a></div></me></main></body></html>`,
11+
};
12+
13+
callback(null, response);
14+
15+
};

serverless.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
service: thomasforicher
2+
3+
provider:
4+
name: aws
5+
runtime: nodejs6.10
6+
region: eu-west-1
7+
stage: prod
8+
9+
functions:
10+
hello:
11+
handler: handler.hello
12+
timeout: 10
13+
memorySize: 128
14+
events:
15+
- http:
16+
path: /
17+
method: get
18+
cors: true

0 commit comments

Comments
 (0)