This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "list-of-ingredients-client", | |
"version": "0.1.0", | |
"private": true, | |
"proxy": "http://localhost:3001", | |
"dependencies": { | |
"react-scripts": "0.9.3", | |
"react": "^15.4.2", | |
"react-dom": "^15.4.2", | |
"semantic-ui-css": "^2.2.9", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec rails s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://help.github.com/ignore-files/ for more about ignoring files. | |
# dependencies | |
/node_modules | |
# testing | |
/coverage | |
# misc | |
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku buildpacks:add heroku/nodejs --index 1 | |
heroku buildpacks:add heroku/ruby --index 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
componentDidMount() { | |
window.fetch('api/drinks') | |
.then(response => response.json()) | |
.then(json => console.log(json)) | |
.catch(error => console.log(error)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: cd client && PORT=3000 npm start | |
api: PORT=3001 && bundle exec rails s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
devise_for :admin_users, ActiveAdmin::Devise.config | |
ActiveAdmin.routes(self) | |
scope '/api' do | |
resources :drinks | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DrinksController < ApplicationController | |
def show | |
render json: { | |
title: "Sparkling Negroni", | |
ingredients: [ | |
"⅓ oz. Campari", | |
"⅓ oz. gin", | |
"⅓ oz. sweet vermouth", | |
"Chilled prosecco, or other sparkling wine, for topping", | |
"Orange peel twist (optional)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "client", | |
"version": "0.1.0", | |
"private": true, | |
"proxy": "http://localhost:3001", | |
"devDependencies": { | |
"react-scripts": "0.9.0", | |
}, | |
"dependencies": { | |
"react": "^15.4.2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "list-of-ingredients", | |
"engines": { | |
"node": "6.3.1" | |
}, | |
"scripts": { | |
"build": "cd client && npm install && npm run build && cd ..", | |
"deploy": "cp -a client/build/. public/", | |
"postinstall": "npm run build && npm run deploy && echo 'Client built!'" | |
} |