mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Improving examples
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
<h1>axios.get</h1>
|
||||
<ul id="people" class="list-unstyled"></ul>
|
||||
|
||||
<script src="/dist/axios.min.js"></script>
|
||||
<script src="/axios.min.js"></script>
|
||||
<script>
|
||||
axios.get('people.json')
|
||||
axios.get('/get/server')
|
||||
.then(function (response) {
|
||||
document.getElementById('people').innerHTML = response.data.map(function (person) {
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[
|
||||
var people = [
|
||||
{
|
||||
"name": "Matt Zabriskie",
|
||||
"github": "mzabriskie",
|
||||
@@ -23,4 +23,12 @@
|
||||
"twitter": "chrisesplin",
|
||||
"avatar": "878947"
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
module.exports = function (req, res) {
|
||||
res.writeHead(200, {
|
||||
'Content-Type': 'text/json'
|
||||
});
|
||||
res.write(JSON.stringify(people));
|
||||
res.end();
|
||||
};
|
||||
Reference in New Issue
Block a user