mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
Use https for API calls
This commit is contained in:
parent
53499f2a6b
commit
4f60d4250e
@ -12,7 +12,7 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
data ({ params, error }) {
|
||||
return axios.get(`http://jsonplaceholder.typicode.com/users/${params.id}`)
|
||||
return axios.get(`https://jsonplaceholder.typicode.com/users/${params.id}`)
|
||||
.then((res) => res.data)
|
||||
.catch(() => {
|
||||
error({ message: 'User not found', statusCode: 404 })
|
||||
|
@ -14,7 +14,7 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return axios.get('http://jsonplaceholder.typicode.com/users')
|
||||
return axios.get('https://jsonplaceholder.typicode.com/users')
|
||||
.then((res) => {
|
||||
return { users: res.data }
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user