Commit 32d9b75d authored by Brikou CARRE's avatar Brikou CARRE Committed by Arunoda Susiripala

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

parent a779d830
...@@ -3,7 +3,7 @@ const fetch = require('isomorphic-fetch') ...@@ -3,7 +3,7 @@ const fetch = require('isomorphic-fetch')
module.exports = { module.exports = {
async exportPathMap () { async exportPathMap () {
// we fetch our list of posts, this allow us to dynamically generate the exported pages // 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() const postList = await response.json()
// tranform the list of posts into a map of pages with the pathname `/post/:id` // tranform the list of posts into a map of pages with the pathname `/post/:id`
......
...@@ -7,7 +7,7 @@ import Post from '../components/post' ...@@ -7,7 +7,7 @@ import Post from '../components/post'
export default class extends Component { export default class extends Component {
static async getInitialProps () { static async getInitialProps () {
// fetch list of posts // 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() const postList = await response.json()
return { postList } return { postList }
} }
......
...@@ -6,7 +6,7 @@ import fetch from 'isomorphic-fetch' ...@@ -6,7 +6,7 @@ import fetch from 'isomorphic-fetch'
export default class extends Component { export default class extends Component {
static async getInitialProps ({ query }) { static async getInitialProps ({ query }) {
// fetch single post detail // 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() const post = await response.json()
return { ...post } return { ...post }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment