What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-27 11:55:30
github react starter disques
import React from 'react'; import PropTypes from 'prop-types'; const SHORTNAME = 'example'; const WEBSITE_URL = 'http://www.example.com'; function renderDisqus() { if (window.DISQUS === undefined) { var script = document.createElement('script'); ... Add solution -
Javascript 2022-03-04 22:05:39
hide urls in .env in react app
WARNING: Do not store any secrets (such as private API keys) in your React app! Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files. outside our src folder create .env file and add it to gitigno... Add solution -
Javascript 2022-03-02 14:15:03
ssh tunnel connect to mongodb in node.js
var config = { username:'myusername', host:'my.ip.address', agent : process.env.SSH_AUTH_SOCK, privateKey:require('fs').readFileSync('/Users/myusername/.ssh/id_rsa'), port:22, dstPort:27017, password:'mypassword' }; var server... Add solution -
Javascript 2022-03-02 13:15:09
simple express server
const express = require('express'); const app = express(); const PORT = process.env.PORT || 3000; app.get('/', (req, res) => { res.send('<h1>Some HTML</h1>'); res.send('<p>Even more HTML</p>'); }); app.listen(PORT, () =>... Add solution -
Javascript 2022-03-02 11:35:19
sendgrid nodejs send email template
const sgMail = require('@sendgrid/mail'); sgMail.setApiKey(process.env.SENDGRID_API_KEY); const msg = { to: '[email protected]', from: '[email protected]', templateId: 'd-f43daeeaef504760851f727007e0b5d0', dynamic_template_data: { subject... Add solution -
Javascript 2022-02-28 11:15:03
send token in axios header
import axios from "axios"; const httpClient = axios.create({ baseURL: "http://youradress", // baseURL: process.env.APP_API_BASE_URL, }); httpClient.interceptors.request.use(function (config) { const token = localStora... Add solution