update readme, add s3 bucket to webpack config

This commit is contained in:
catarak 2016-07-20 19:48:00 -04:00
parent f0872f8173
commit 7952eee7bd
4 changed files with 12 additions and 3 deletions

View file

@ -12,8 +12,11 @@ This project is currently in the early stages of development! It will definitely
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
PORT=8000
SESSION_SECRET=whatever_you_want_this_to_be_it_only_matters_for_production
AWS_ACCESS_KEY=<your-aws-access-key>
AWS_SECRET_KEY=<your-aws-secret-key>
S3_BUCKET=<your-s3-bucket>
```
Or, if you don't want to do that, just ask me to send you mine.
Or, if you don't want to do that, just ask me to send you mine. Refer to this gist for creating an S3 bucket for testing, or if you don't want to do that, I will send you my AWS credentials.
5. `$ npm start`
6. Navigate to (http://localhost:8000)[http://localhost:8000] in your browser
7. Install the [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en).
@ -28,6 +31,9 @@ Or, if you don't want to do that, just ask me to send you mine.
MONGO_URL=mongodb://localhost:27017/p5js-web-editor
PORT=8000
SESSION_SECRET=make_this_a_long-random_string_like_maybe_126_characters_long
AWS_ACCESS_KEY=<your-aws-access-key>
AWS_SECRET_KEY=<your-aws-secret-key>
S3_BUCKET=<your-s3-bucket>
```
Or, if you don't want to do that, just ask me to send you mine.
5. `$ npm run build`

View file

@ -1,7 +1,7 @@
import axios from 'axios';
import { createFile } from './files';
const s3Bucket = 'http://p5js-web-editor-test.s3.amazonaws.com/';
const s3Bucket = `http://${process.env.S3_BUCKET}.s3.amazonaws.com/`;
const ROOT_URL = location.href.indexOf('localhost') > 0 ? 'http://localhost:8000/api' : '/api';
export function dropzoneAcceptCallback(file, done) {

View file

@ -1,4 +1,5 @@
var webpack = require('webpack');
require('dotenv').config();
module.exports = {
devtool: 'cheap-module-eval-source-map',
@ -19,6 +20,7 @@ module.exports = {
'process.env': {
CLIENT: JSON.stringify(true),
'NODE_ENV': JSON.stringify('development'),
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
}
})
],

View file

@ -44,7 +44,8 @@ module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
'NODE_ENV': JSON.stringify('production'),
'S3_BUCKET': '"' + process.env.S3_BUCKET + '"'
}
}),
new webpack.optimize.UglifyJsPlugin({