Skip to content

Instantly share code, notes, and snippets.

@TaylorAckley
Last active May 13, 2018 03:44
Show Gist options
  • Save TaylorAckley/639d975360f076fa89a74d6a219d078d to your computer and use it in GitHub Desktop.
Save TaylorAckley/639d975360f076fa89a74d6a219d078d to your computer and use it in GitHub Desktop.
Api Keys Script
const ApiKey = require('../../lib/models/api-key.model');
// Bootstrap default AO
ApiKey.findOneAndUpdate({
origin: 'https://localhost:4200'
}, {
$set: {
// This is our default allowed origin, typically where your front-end is served from, ie myapp.com. In this case we use Angular's default serve port.
origin: 'https://localhost:4200'
}
}, {
upsert: true,
setDefaultsOnInsert: true
}).catch(err => //handle error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment