Skip to content

Commit 050e25b

Browse files
committed
Replace url of Star Wars API
The url for the SWAPI has changed from `swapi.co` to `swapi.dev`
1 parent 7260334 commit 050e25b

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

chapter-11/swapi-cli/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const axios = require('axios')
22
const readline = require('readline')
33
const inquirer = require("inquirer")
44

5-
const BASE_URL = "https://swapi.co/api/"
5+
const BASE_URL = "https://swapi.dev/api/"
66

77
const rl = readline.createInterface({
88
input: process.stdin,

chapter-4/ajax-lab/solution-code/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let name = '',
44
filmNames = ''
55
let hello = "Hello! My name is {name} and I'm from {planet}. I've been in {films} and I'm a Jedi."
66

7-
fetch('https://swapi.co/api/people/1/')
7+
fetch('https://swapi.dev/api/people/1/')
88
.then((response) => {
99
return response.json()
1010
})

chapter-4/ajax-lab/starter-code/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let name = '',
44
filmNames = ''
55
let hello = "Hello! My name is {name} and I'm from {planet}. I've been in {films} and I'm a Jedi."
66

7-
fetch('https://swapi.co/api/people/1/')
7+
fetch('https://swapi.dev/api/people/1/')
88
// write your code here.
99
.then((response) => {
1010
hello = hello.replace('{name}', name).replace('{planet}', planet).replace('{films}', filmNames)

chapter-4/ajax/swapi-2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fetch('https://swapi.co/api/people/1/')
1+
fetch('https://swapi.dev/api/people/1/')
22
.then((response) => {
33
return response.json()
44
})

chapter-4/ajax/swapi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fetch('https://swapi.co/api/people/1/')
1+
fetch('https://swapi.dev/api/people/1/')
22
.then((response) => {
33
return response.json()
44
})

chapter-7/swapi/solution-code/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SWAPI {
2929

3030
getPeople() {
3131
new Promise((resolve, reject) => {
32-
this.fetchThis('https://swapi.co/api/people', this.people, resolve, reject)
32+
this.fetchThis('https://swapi.dev/api/people', this.people, resolve, reject)
3333
})
3434
.then((response) => {
3535
this.people = response

chapter-8/swapi-jQuery/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $(document).ready(function() {
66

77
var SWAPI = function() {
88
this.constructor();
9-
this.getPeople('https://swapi.co/api/people/', this.people);
9+
this.getPeople('https://swapi.dev/api/people/', this.people);
1010
$('.go').click(function(e) {
1111
swapi.getPerson($('#peopleSelector').val())
1212
});

chapter-8/swapi/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SWAPI {
2929

3030
getPeople() {
3131
new Promise((resolve, reject) => {
32-
this.fetchThis('https://swapi.co/api/people', this.people, resolve, reject)
32+
this.fetchThis('https://swapi.dev/api/people', this.people, resolve, reject)
3333
})
3434
.then((response) => {
3535
this.people = response

chapter-9/error-object/index-mitigated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const typoError = () => {
77
}
88

99
const fetchAttempt = () => {
10-
fetch("https://swapi.co/api/undefined")
10+
fetch("https://swapi.dev/api/undefined")
1111
.then((response) => {
1212
try {
1313
return response.json()

chapter-9/error-object/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const typoError = () => {
33
}
44

55
const fetchAttempt = () => {
6-
fetch("https://swapi.co/api/undefined")
6+
fetch("https://swapi.dev/api/undefined")
77
.then((response) => {
88
try {
99
return response.json()

0 commit comments

Comments
 (0)