This file contains hidden or 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
Show hidden characters
{ | |
"presets": [ | |
"env", | |
"react", | |
"stage-0" | |
] | |
} |
This file contains hidden or 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
const webpack = require('webpack'); | |
module.exports = { | |
module: { | |
rules: [ | |
{ | |
test: /\.(js|jsx)$/, | |
exclude: /node_modules/, | |
use: ['babel-loader'] | |
} |
This file contains hidden or 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
async handleClick() { | |
try { | |
const res = await axios.get( | |
"https://em1p285uhk.execute-api.us-east-2.amazonaws.com/default/BloodyLambda" | |
); | |
this.setState({ | |
firstName: res.data.firstName, | |
lastName: res.data.lastName | |
}); |
This file contains hidden or 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
const forecast = document.querySelector(".forecast"); | |
const temperature = document.querySelector(".temperature"); | |
const btn = document.querySelector("button"); | |
async function getWeatherData() { | |
const returnData = await axios.get( | |
"api.openweathermap.org/data/2.5/weather?id={MyAPIKeyGoezHere}", | |
{ | |
headers: { | |
'Access-Control-Allow-Origin': '*', |
This file contains hidden or 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
exports.up = function (knex, Promise) { | |
return knex.schema.createTableIfNotExists('authors', function (table) { | |
table.increments('uid').primary(); | |
table.string('name'); | |
table.string('password'); | |
table.string('email'); | |
}) | |
.then(res => { | |
return knex.schema.createTableIfNotExists('thunks', function (table) { | |
table.increments('id').primary(); |
This file contains hidden or 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
"dependencies": { | |
"react": "^16.4.1", | |
"react-dom": "^16.4.1", | |
"webpack": "^4.12.1", | |
"webpack-cli": "^3.0.8", | |
"webpack-dev-server": "^3.1.4" | |
}, | |
"devDependencies": { | |
"@babel/preset-env": "^7.0.0-beta.51", | |
"@babel/core": "^7.0.0-beta.51", |
This file contains hidden or 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
exports.up = function (knex, Promise) { | |
return knex.schema.createTable('authors', function (table) { | |
table.increments('uid').primary(); | |
table.string('name'); | |
table.string('password'); | |
table.string('email'); | |
}) | |
.then(res => { | |
return knex.schema.createTable('thunks', function (table) { | |
table.increments('id').primary(); |
This file contains hidden or 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
const { Client } = require('pg') | |
const client = new Client() | |
await client.connect() | |
const res = await client.query('SELECT $1::text as message', ['Hello world!']) | |
console.log(res.rows[0].message) // Hello world! | |
await client.end() |
This file contains hidden or 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
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
app.get('/', (req, res) => { | |
res.sendFile(path.join(__dirname + '/index.html')); | |
}); | |
const port = process.env.PORT || 5656; |
This file contains hidden or 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
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
app.get('/', (req, res) => { | |
res.sendFile(path.join(__dirname + '/index.html')); | |
}); | |
const port = process.env.PORT || 5656; |