What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-13 22:24:17
find all mongoose
//create model students const mongoose = require("mongoose"); const Schema = mongoose.Schema; const StudentSchema = new Schema({ name: String, dob: Date, mobile: String, address: String, }); module.exports = mongoose.model("stud... Add solution -
Javascript 2021-11-12 18:22:30
Expressjs Route methods
var express = require('express') var router = express.Router() // middleware that is specific to this router router.use(function timeLog (req, res, next) { console.log('Time: ', Date.now()) next() }) // define the home page route router.get('/', func... Add solution -
Javascript 2021-11-12 17:43:19
nodejs encrypt text with key
const crypto = require('crypto'); const algorithm = 'aes-256-ctr'; const secretKey = 'vOVH6sdmpNWjRRIqCc7rdxs01lwHzfr3'; const iv = crypto.randomBytes(16); const encrypt = (text) => { const cipher = crypto.createCipheriv(algorithm, secretKey, iv... Add solution -
Shell/Bash 2021-11-09 09:50:06
gatsby-plugin-styled-components
npm install --save gatsby-plugin-styled-components styled-components babel-plugin-styled-components # yarn yarn add gatsby-plugin-styled-components styled-components babel-plugin-styled-components # Edit gatsby-config.js module.exports = { plugins... Add solution