Skip to content

Commit c923bd4

Browse files
committed
Step 3
1 parent 739b7c3 commit c923bd4

File tree

6 files changed

+50
-653
lines changed

6 files changed

+50
-653
lines changed

config/prod.env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict'
22
module.exports = {
3-
NODE_ENV: '"production"'
3+
NODE_ENV: '"production"',
4+
API_URL: '"https://api.stackexchange.com/2.2/"',
45
}

package-lock.json

Lines changed: 29 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "node build/build.js"
1212
},
1313
"dependencies": {
14+
"axios": "^0.17.1",
1415
"vue": "^2.5.2",
1516
"vue-router": "^3.0.1"
1617
},

src/api/questions.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import axios from 'axios'
2+
3+
/**
4+
* @param {string="vue"} search
5+
* @return {Promise<Object>} List of questions
6+
* @see {@link https://api.stackexchange.com/docs/search}
7+
* @see {@link https://api.stackexchange.com/docs/types/question}
8+
*/
9+
export function searchQuestions (search = 'vue') {
10+
return axios.get(`${process.env.API_URL}search?order=desc&sort=votes&intitle=${search}&site=stackoverflow`)
11+
}

0 commit comments

Comments
 (0)