Created
February 28, 2017 22:39
-
-
Save frenchbread/d30d19adfc4db2a50d0cc1058aeb83ed to your computer and use it in GitHub Desktop.
Migrate stuff from one sails server to another
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
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