Skip to content

Commit f6445d9

Browse files
author
David Brainer-Banker
committed
Add authentication
1 parent 50e7bb8 commit f6445d9

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: ./node_modules/.bin/http-server ./storybook -s -p $PORT
1+
web: node app

app.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var server = require('auth-static');
2+
3+
server({
4+
options: {
5+
gzip: true
6+
},
7+
node_env: process.env.NODE_ENV,
8+
username: process.env.AUTH_USERNAME,
9+
password: process.env.AUTH_PASSWORD,
10+
root: './storybook',
11+
port: 9001
12+
});

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"build-storybook": "build-storybook -o ./storybook",
88
"dist": "scripts/dist.sh",
9-
"heroku-prebuild": "./scripts/heroku-prebuild.sh",
109
"heroku-postbuild": "./scripts/heroku-postbuild.sh",
1110
"icons": "./node_modules/.bin/babel-node scripts/inline-icons.js",
1211
"lint": "eslint --config=./.eslintrc components",
@@ -64,6 +63,7 @@
6463
"@salesforce-ux/design-system": "1.0.3",
6564
"@salesforce-ux/icons": "4.0.0",
6665
"async": "^2.0.0-rc.5",
66+
"auth-static": "^1.0.2",
6767
"babel": "^6.5.2",
6868
"babel-cli": "^6.9.0",
6969
"babel-core": "^6.9.0",
@@ -81,7 +81,6 @@
8181
"eslint-plugin-jsx-a11y": "^1.2.0",
8282
"eslint-plugin-react": "^5.1.1",
8383
"file-loader": "^0.8.4",
84-
"http-server": "^0.9.0",
8584
"isparta-loader": "^2.0.0",
8685
"istanbul": "^1.0.0-alpha.2",
8786
"json-loader": "^0.5.3",

scripts/heroku-postbuild.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
echo "# Building for Heroku"
1313

1414
npm run build-storybook
15+
16+
echo "## Add meta tag"
17+
18+
sed -i '' 's|<head>|<head><meta charset="UTF-8">|' storybook/*.html

0 commit comments

Comments
 (0)