View 4-pea-1-main.js
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
const {autoUpdater} = require('electron-updater') | |
let mainWindow | |
const checkingForUpdates = () => console.log('checking for updates') | |
const createWindow = () => { | |
setTimeout(checkingForUpdates, 3000) | |
// ... | |
} |
View 2-pea-w-package.json
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
{ | |
"build": { | |
"win": { | |
"certificateFile": "config/slack.p12", | |
"certificatePassword": "" | |
} | |
} | |
} |
View 2-pea-wfw-package.json
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
{ | |
"build": { | |
"win": { | |
"certificateFile": "config/slack.p12", | |
"certificatePassword": "", | |
"verifyUpdateCodeSignature": false, | |
"publisherName": "slack", | |
"artifactName": "${productName}.${ext}" | |
} | |
} |
View 2-pea-mfw-package.json
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
{ | |
"build": { | |
"win": { | |
"certificateFile": "config/slack.p12", | |
"certificatePassword": "", | |
"verifyUpdateCodeSignature": false, | |
"artifactName": "${productName}.${ext}" | |
} | |
} | |
} |
View 1-pea-2-package.jsonc
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
Show hidden characters
{ | |
// ...other fields | |
"scripts": { | |
"build:all": "electron-builder -wml" | |
"build:win": "electron-builder -w" | |
"build:mac": "electron-builder -m" | |
"build:lnx: "electron-builder -l" | |
} | |
// ...other fields | |
} |
View 1-pea-package.jsonc
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
{ | |
// ...other fields | |
"name": "slack", | |
"publicName": "Slack" | |
"author": "Slack Inc." | |
"build": { | |
"appId": "com.slack.desktop", | |
"copyright": "Copyright 2020 Slack" | |
} | |
// ...other fields |
View eifp-for-each.js
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
const a = [1, 2, 4] | |
forEach(console.log, a) | |
// [1, 2, 4] |
View cors.js
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
const cors = require('cors'); | |
const corsHandler = cors({ origin: true }); | |
/* Your other code */ | |
const handleEmail = (req, res) => { | |
corsHandler(req, res, () => { | |
transporter.sendMail(mailOptions(req.query), transport); | |
}); |
View react-app.js
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 Axios from 'axios'; | |
import React, { useState } from 'react'; | |
const sendEmailURL = '<YOUR_FUNCTION_URL>'; | |
function App() { | |
const [state, setState] = useState({ | |
message: '', | |
name: '', | |
subject: '', |
View dynamic-content.js
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
const mailOptions = ({ subject, name, message }) => { | |
const text = ` | |
Name: ${name} | |
Message: ${message} | |
`; | |
const html = ` | |
<h1>Name: ${name}</h1> | |
<p>Message: ${message}</p> | |
`; |
NewerOlder