Skip to content

Instantly share code, notes, and snippets.

View fdjones's full-sized avatar

Freddie fdjones

View GitHub Profile
{
"presets": [
"env",
"react",
"stage-0"
]
}
const webpack = require('webpack');
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
}
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
});
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': '*',
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();
"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",
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();
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()
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;
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;