mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Use https to prevent mixed content when served over https (#2741)
This commit is contained in:
parent
a779d830bd
commit
32d9b75d55
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue