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
(function() { | |
'use strict' | |
angular | |
.module('alabama', []) | |
.component('alabama', { | |
template: 'transclude.component.html', | |
controller: AlabamaComponentController, | |
transclude: { | |
'title': '?alabamaTitle', |
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
@Configuration | |
@EnableWebMvc | |
public class WebConfig extends WebMvcConfigurerAdapter { | |
@Override | |
public void addCorsMappings(CorsRegistry registry) { | |
registry.addMapping("/**") | |
.allowedOrigins("*") | |
.allowedMethods("PUT", "DELETE", "POST", "GET") | |
.allowCredentials(false) |
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
cidade | Afonso Cláudio | |
---|---|---|
cidade | Água Doce do Norte | |
cidade | Águia Branca | |
cidade | Alegre | |
cidade | Alfredo Chaves | |
cidade | Alto Rio Novo | |
cidade | Anchieta | |
cidade | Apiacá | |
cidade | Aracruz | |
cidade | Atilio Vivacqua |
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
{ | |
"name": "Marcos Florencio", | |
"github": "https://github.com/eptaccio", | |
"twitter": "https://twitter.com/eptaccio", | |
"linkedin": "https://www.linkedin.com/in/eptaccio", | |
"telegram": "https://telegram.me/eptaccio", | |
"email": "[email protected]", | |
"medium": "https://medium.com/@eptaccio" | |
} |
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
import http from '../../services/http' | |
http({ | |
method: 'GET', | |
url: '/cars' | |
}) | |
.then(data => console.log(data)) | |
// GET http://localhost:3006/cars |
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
import axios from 'axios' | |
axios({ | |
method:'get', | |
url:'http://dogs.com' | |
}) | |
.then(dogs => console.log(dogs.data)) |
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
// services/http.js | |
import axios from 'axios' | |
export default axios |
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
// services/http.js | |
import axios from 'axios' | |
const configuredAxios = axios.create({ | |
baseURL: 'https://dogs.com/', | |
headers: {'X-Custom-Header': 'foobar'} | |
}) | |
export default configuredAxios |
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
// component.js | |
import http from './services/http' | |
http({ | |
method: 'GET', | |
url: '/cute' | |
}) | |
.then(cuteDog => console.log(cuteDog.data)) |
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
// services/http.js | |
import axios from 'axios' | |
import storage from './storage' | |
const transformResponse = (data) => { | |
// faça o que quiser aqui | |
return data | |
} |