Skip to content

Instantly share code, notes, and snippets.

Avatar

Cole Morrison jcolemorrison

View GitHub Profile
@jcolemorrison
jcolemorrison / example-userdata.sh
Created Jan 16, 2020
EC2 Fundamentals - Automated Node.js Server Launch Custom User Data Script and Examples
View example-userdata.sh
# If your given node application has a different start command, replace the line in the script...
# rest of the userdata.sh script above....
# Start the server
node . > stdout.log 2> stderr.log
# with...
# rest of the userdata.sh script above....
# Start the server
@jcolemorrison
jcolemorrison / userdata.sh
Created Jan 16, 2020
EC2 Fundamentals - Automated Node.js Server Launch User Data Script
View userdata.sh
#!/usr/bin/env bash
# Install Node and Git
yum update -y
curl -sL https://rpm.nodesource.com/setup_10.x | bash -
yum install -y nodejs git
# Make a directory to clone the application code to
mkdir -p /home/ec2-user/app && cd /home/ec2-user/app
git clone https://github.com/jcolemorrison/ec2-lb-api.git .
@jcolemorrison
jcolemorrison / app.js
Last active Aug 29, 2015
Building an Angular and Express App Part 2 - Express Gist
View app.js
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
/**
* Route Imports
*/
@jcolemorrison
jcolemorrison / signup.html
Last active Aug 29, 2015
Building an Angular and Express App Part 2 - Signup route updated
View signup.html
<div class="signup-container">
<div class="col-md-12">
<h3 class="signup-header">Signup as a New User</h3>
<hr>
<br>
</div>
<div class="signup-form">
<form class="form-horizontal">
@jcolemorrison
jcolemorrison / _signup.scss
Last active Aug 29, 2015
Building an Angular and Express App Part 2 - Base Signup Files
View _signup.scss
.signup-container{
margin-top: 5em;
}
.signup-header{
text-align: center;
color: $gray-light;
margin-bottom: 1em;
}
@jcolemorrison
jcolemorrison / package.json
Created Apr 14, 2014
Building an Angular and Express App Part 1: package.json - J Cole Morrison
View package.json
{
"name": "angular-express-part1",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "NODE_ENV=production nodemon ./bin/www",
"test": "NODE_ENV=development nodemon ./bin/www"
},
"dependencies": {
"express": "~4.0.0",
@jcolemorrison
jcolemorrison / www
Created Apr 14, 2014
Building an Angular and Express App Part 1: /bin/www - J Cole Morrison
View www
#!/usr/bin/env node
var debug = require('debug')('my-application');
var app = require('../app');
app.set('port', process.env.PORT || 3000);
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
});
@jcolemorrison
jcolemorrison / app.js
Created Apr 14, 2014
Building an Angular and Express App Part 1: app.js - J Cole Morrison
View app.js
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');