Skip to content

Instantly share code, notes, and snippets.

Josiah Wiebe josiahwiebe

Block or report user

Report or block josiahwiebe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@josiahwiebe
josiahwiebe / json.js
Created Nov 16, 2018
basic json body parser
View json.js
const getRawBody = require('raw-body')
const parseJSON = str => {
try {
return JSON.parse(str)
} catch (err) {
throw new Error('Invalid JSON', err)
}
}
@josiahwiebe
josiahwiebe / api.js
Created Feb 9, 2018
Polka NextJS + API Example
View api.js
const polka = require('polka')
module.exports = polka()
.get('/', (req, res) => {
res.end('this is the api')
})
@josiahwiebe
josiahwiebe / api.js
Created Feb 9, 2018
Express NextJS + API Example
View api.js
const express = require('express')
const router = express.Router()
router.get('/', (req, res) => {
res.status(200).json({message: 'hello from api'})
})
module.exports = router
@josiahwiebe
josiahwiebe / all.txt
Last active Dec 15, 2017
LTV Travelers Clubs
View all.txt
Carolina LTV'ers
Great North East Travelers
Dixie Leisure Travelers
Southwest LTV Roadrunners
Leisurely Great Lakers
Heartland LTV'ers
Blue Ridge Leisures
Flamingles
Texoma Travelers
Midwest LTVers
@josiahwiebe
josiahwiebe / cors.js
Created Sep 29, 2016
CORS with ExpressJS
View cors.js
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Methods', 'GET,OPTIONS')
res.header('Access-Control-Allow-Headers', 'content-Type, X-Requested-With')
next()
})
@josiahwiebe
josiahwiebe / cors.js
Created Sep 29, 2016
Cors with ExpressJS
View cors.js
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Methods', 'GET,OPTIONS')
res.header('Access-Control-Allow-Headers', 'content-Type, X-Requested-With')
next()
})
View file.json
[
{
"number": 1,
"name": "alderlot01",
"status": "sold"
},
{
"number": 2,
"name": "alderlot02",
"status": "available"
@josiahwiebe
josiahwiebe / all.txt
Last active Feb 6, 2019
List of LTV Dealers
View all.txt
Auto Wheels In Motion
Big Boy's Toys
Country RV
Craig Smith RV Center
Earlton RV
Fretz RV
GNR Camping World
Grove RV
Guarantee RV
Holland Motorhomes
View southwest.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josiahwiebe
josiahwiebe / nz-2011.geojson
Created Dec 8, 2015
Photo locations from NZ trip in 2011
View nz-2011.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.