init
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
const axios = require('axios')
|
||||
|
||||
module.exports = function (api) {
|
||||
api.loadSource(async store => {
|
||||
const { data } = await axios.get('http://api.archives-ouvertes.fr/search/?q=docid:2172000&fl=*')
|
||||
|
||||
const contentType = store.addContentType({
|
||||
typeName: 'article',
|
||||
})
|
||||
|
||||
let item = data.response.docs[0];
|
||||
contentType.addNode({
|
||||
id: item.docid,
|
||||
title: item.title_s[0],
|
||||
path:"article",
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user