提交 32d9b75d 编写于 作者: B Brikou CARRE 提交者: Arunoda Susiripala

Use https to prevent mixed content when served over https (#2741)

上级 a779d830
......@@ -3,7 +3,7 @@ const fetch = require('isomorphic-fetch')
module.exports = {
async exportPathMap () {
// we fetch our list of posts, this allow us to dynamically generate the exported pages
const response = await fetch('http://jsonplaceholder.typicode.com/posts?_page=1')
const response = await fetch('https://jsonplaceholder.typicode.com/posts?_page=1')
const postList = await response.json()
// tranform the list of posts into a map of pages with the pathname `/post/:id`
......
......@@ -7,7 +7,7 @@ import Post from '../components/post'
export default class extends Component {
static async getInitialProps () {
// fetch list of posts
const response = await fetch('http://jsonplaceholder.typicode.com/posts?_page=1')
const response = await fetch('https://jsonplaceholder.typicode.com/posts?_page=1')
const postList = await response.json()
return { postList }
}
......
......@@ -6,7 +6,7 @@ import fetch from 'isomorphic-fetch'
export default class extends Component {
static async getInitialProps ({ query }) {
// fetch single post detail
const response = await fetch(`http://jsonplaceholder.typicode.com/posts/${query.id}`)
const response = await fetch(`https://jsonplaceholder.typicode.com/posts/${query.id}`)
const post = await response.json()
return { ...post }
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册