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 express = require('express') | |
var numCPUs = require('os').cpus().length; | |
const cluster = require('cluster'); | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send('Hello World!') | |
}); |
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 viewModelProps = { | |
title: { type: String, isRequired: true, minLength: 5, unique: true, index: true }, | |
category: { type: String, isRequired: true }, | |
} | |
// in mongoose | |
const videoSchema = new mongoose.Schema({ | |
...generateSchema(true, viewModelProps), | |
duration: { | |
type: Number, |
OlderNewer