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 { MongoClient } from 'mongodb'; | |
const dbUri = `mongodb+srv://${process.env.MONGO_DB_USERNAME}:${process.env.MONGO_DB_PASSWORD}@${process.env.MONGO_DB_CLUSTER}?retryWrites=true&w=majority`; | |
export default { | |
connection: null, | |
async connect() { | |
if (this.connection) { | |
return this.connection; | |
} |
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 { MongoClient } from 'mongodb'; | |
const dbUri = `mongodb+srv://${process.env.MONGO_DB_USERNAME}:${process.env.MONGO_DB_PASSWORD}@${process.env.MONGO_DB_CLUSTER}?retryWrites=true&w=majority`; | |
let dbCachedConnection = null; | |
const connectToDb = async () => { | |
if (dbCachedConnection) { | |
return dbCachedConnection; | |
} |
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
{ | |
"event": { | |
"path": "/.netlify/functions/echo", | |
"httpMethod": "GET", | |
"headers": { | |
"accept": "", | |
"accept-encoding": "", | |
"accept-language": "", | |
"client-ip": "", | |
"connection": "", |
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
export async function handler(event, context) { | |
return { | |
statusCode: 200, | |
body: JSON.stringify({ | |
event: event, | |
workingDirectory: process.env.PWD, | |
netlifyDev: process.env.NETLIFY_DEV, | |
nodeEnv: process.env.NODE_ENV, | |
}), | |
}; |
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 { MongoClient } from 'mongodb'; | |
const dbUri = `mongodb+srv://${process.env.MONGO_DB_USERNAME}:${process.env.MONGO_DB_PASSWORD}@${process.env.MONGO_DB_CLUSTER}?retryWrites=true&w=majority`; | |
export async function handler(event, context) { | |
const dbClient = new MongoClient(dbUri, { useNewUrlParser: true }); | |
await dbClient.connect(); | |
const dbBoardCollection = dbClient.db('workboard').collection('board'); | |
const dbBoardDocs = await dbBoardCollection.find({}).toArray(); |
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
export async function handler(event, context) { | |
return { | |
statusCode: 200, | |
body: JSON.stringify({}), | |
}; | |
}; |
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
{ | |
"id": "luckySix", | |
"name": "Lucky Six", | |
"lagalName": "NSoft Lucky Six", | |
"keywords": [ | |
"luckysix", | |
"lucky", | |
"six", | |
"bingo" | |
], |
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
.articleItem { | |
padding: 12px; | |
margin-bottom: 12px; | |
background-color: #fff; | |
display: flow-root; | |
position: relative; | |
cursor: pointer; | |
text-decoration: none; | |
color: black; |
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
export default [ | |
{ | |
id: 1, | |
title: 'This is the Most Important Feature in Vue', | |
author: 'Michael Thiessen', | |
date: '2019-11-15', | |
thumb: 'images/avatar1.jpeg', | |
category: 'features', | |
text: '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem |
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
{ | |
"type": "state", | |
"data": { | |
"sports": { | |
"1": { | |
"idSport": "1", | |
"sportName": "Soccer", | |
"sportShortName": "Soccer", | |
"sportActive": 1, | |
"sportPosition": 1, |