Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Commit

Permalink
Some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
hisener committed Jun 2, 2017
1 parent 2797473 commit 1958dce
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -22,10 +22,11 @@ localhost:3000
```

### Demo
TOOD: Deploy on heroku
https://pirate-radio.herokuapp.com/

### TODO
- [ ] More documentation (mostly client side)
- [ ] AppBar > More Icon > About

## License

Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"main": "src/server/index.js",
"scripts": {
"dev": "gulp watch & nodemon -w src/server --exec \"babel-node src/server\"",
"prestart": "gulp --env=production build",
"postinstall": "gulp --env=production build",
"start": "NODE_ENV=production node dist/server",
"test": "standard && npm run test-node",
"test-node": "tape test/*.js"
Expand All @@ -23,6 +23,7 @@
"babel-preset-stage-0": "^6.24.1",
"babelify": "^7.3.0",
"browserify": "^14.3.0",
"compression": "^1.6.2",
"express": "^4.15.2",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
Expand Down
28 changes: 27 additions & 1 deletion src/client/containers/App.js
Expand Up @@ -4,6 +4,11 @@ import getMuiTheme from 'material-ui/styles/getMuiTheme'
import { deepOrange500 } from 'material-ui/styles/colors'

import AppBar from 'material-ui/AppBar'
import IconButton from 'material-ui/IconButton'
import FlatButton from 'material-ui/FlatButton'
import IconMenu from 'material-ui/IconMenu'
import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert'

import ActiveRadio from './ActiveRadio'
import Content from './Content'

Expand All @@ -22,10 +27,31 @@ const muiTheme = getMuiTheme({
}
})

const RightIconMenu = (props) => (
<IconMenu
{...props}
iconButtonElement={
<IconButton><MoreVertIcon /></IconButton>
}
targetOrigin={{horizontal: 'right', vertical: 'top'}}
anchorOrigin={{horizontal: 'right', vertical: 'top'}}
>
<FlatButton
target='_blank'
href='https://github.com/hisener/pirate-radio'
label='GitHub'
/>
</IconMenu>
)

const App = () => (
<MuiThemeProvider muiTheme={muiTheme}>
<div style={styles.container}>
<AppBar title={title} showMenuIconButton={false} />
<AppBar
title={title}
showMenuIconButton={false}
iconElementRight={<RightIconMenu />}
/>
<ActiveRadio />
<Content />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/client/containers/Root.js
Expand Up @@ -10,13 +10,13 @@ let preloadedState = {
{
'id': '16534',
'title': 'Capital London',
'image': 'http://cdn-radiotime-logos.tunein.com/s16534q.png',
'image': 'https://cdn-radiotime-logos.tunein.com/s16534q.png',
'song': 'Unknown',
'stream': 'http://media-the.musicradio.com/CapitalMP3'
}, {
'id': '126794',
'title': '181.FM UK Top 40',
'image': 'http://cdn-radiotime-logos.tunein.com/s126794q.png',
'image': 'https://cdn-radiotime-logos.tunein.com/s126794q.png',
'song': 'Unknown',
'stream': 'http://listen.181fm.com/181-uktop40_128k.mp3?noPreRoll=true'
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/index.js
@@ -1,5 +1,5 @@
export const isProd = process.env.NODE_ENV === 'production'
export const protocol = 'http'
export const port = isProd ? 8080 : 3000
export const port = isProd ? (process.env.PORT || 8080) : 3000

export const title = 'Pirate Radio'
4 changes: 4 additions & 0 deletions src/server/index.js
@@ -1,6 +1,7 @@
import http from 'http'
import express from 'express'
import path from 'path'
import compression from 'compression'

import { port } from '../config'
import routes from './routes'
Expand All @@ -16,6 +17,9 @@ app.set('views', path.join(__dirname, 'views'))
app.use(express.static(path.join(__dirname, '../../static')))
app.use('/', routes)

// compress all requests
app.use(compression())

// catch 404 and forward to error handler
app.use(middlewares.notFound)

Expand Down

0 comments on commit 1958dce

Please sign in to comment.