Skip to content

Instantly share code, notes, and snippets.

@frenchbread
Created February 28, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frenchbread/d30d19adfc4db2a50d0cc1058aeb83ed to your computer and use it in GitHub Desktop.
Save frenchbread/d30d19adfc4db2a50d0cc1058aeb83ed to your computer and use it in GitHub Desktop.
Migrate stuff from one sails server to another
migrate () {
this.notify.info('success')
axios.get(`http://127.0.0.1:1337/servers?limit=1000`)
.then(res => {
const servers = res.data
this.notify.info('Success', `Found ${servers.length} servers.`)
_.forEach(servers, server => {
this.apiServers.add(server)
.then(res => console.log(res))
.catch(err => console.error(err))
})
this.notify.success('Done!')
})
.catch(err => this.notify.error('Err', err.message))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment