Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const config = this._appContext.config
- const httpUserName = config.authentication.user
- const httpPassword = config.authentication.password
- const options = {
- auth:{
- user: httpUserName ,
- pass: httpPassword
- }
- }
- return programmedSpotsData.map((item)=>{
- let localFile = null
- let remoteFile = null
- /**
- *@todo DRY em logica de remote, local file
- */
- if(item.file.startsWith(config.localUrl)){
- remoteFile = item.file.replace(config.localUrl,config.urls.remoteServerUrl + '/remote/')
- remoteFile = remoteFile.replace(/\/id\/[^\/]*/,'')
- let dir = config.dirs.spots
- if(item.type_sub==='class' || item.type.type_sub==='custom_class'){
- dir = config.dirs.class
- }
- localFile = dir+item.id+config.spotExtension
- }
- else{//ALready saved
- localFile = path.resolve(__dirname,'./webSite/'+item.file)
- }
- return {
- options,
- localFile,
- remoteFile
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement