forked from backspace-academy/aws-nodejs-eb-codebuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (20 loc) · 629 Bytes
/
app.js
File metadata and controls
27 lines (20 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Load the AWS SDK
var AWS = require('aws-sdk')
var express = require('express')
var bodyParser = require('body-parser')
// Set region for AWS SDKs
AWS.config.region = process.env.REGION
var app = express()
app.set('view engine', 'pug')
app.set('views', __dirname + '/views')
app.use(bodyParser.urlencoded({extended:false}))
app.get('/', function (req, res) {
res.render('index', {
title: 'BackSpace Academy & Elastic Beanstalk'
})
res.status(200).end();
})
var port = process.env.PORT || 3000
var server = app.listen(port, function () {
console.log('Server running at http://127.0.0.1:' + port + '/')
})