Skip to content

Instantly share code, notes, and snippets.

View astrotars's full-sized avatar
⛰️

Nick Parsons astrotars

⛰️
View GitHub Profile
go build -o passwordless-social .
./passwordless-social
psql -U postgres
CREATE DATABASE passwordless_social;
\c passwordless_social
export default {
env: process.env.NODE_ENV || 'development',
server: {
port: process.env.PORT || 8080,
},
google: {
projectId: '<YOUR_PROJECT_ID>',
bucket: '<YOUR_BUCKET_NAME>',
},
};
export default {
env: process.env.NODE_ENV || 'development',
server: {
port: process.env.PORT || 8080,
},
google: {
projectId: '<YOUR_PROJECT_ID>',
bucket: '<YOUR_BUCKET_NAME>',
},
};
import uuid from 'uuid/v4';
import mime from 'mime-types';
import { Storage } from '@google-cloud/storage';
import config from '../config';
exports.create = async (req, res, next) => {
const type = mime.lookup(req.file.originalname);
const storage = new Storage({
import uuid from 'uuid/v4';
import multer from 'multer';
import Upload from '../controllers/upload';
import config from '../config';
module.exports = api => {
api.route('/upload').post(multer().single('image'), Upload.create);
};
const client = stream.connect(key, secret);
module.exports.token = (event, context, callback) => {
const data = JSON.parse(event.body);
const token = client.createUserSessionToken(data.user);
const response = {
statusCode: 200,
headers: {
session.feed('user').follow('user', userIdOfUserThatShouldBeFollowed);
serverless invoke local --function crawl