Backend: Begin issue API
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
f6a6beb61a
commit
b21ac8d562
@ -83,6 +83,7 @@ The app is designed to be run within Kubernetes or within a Docker container, as
|
|||||||
|OWL_LDB_CORPUSUSER||YES|Network Rail CORPUS API Username|
|
|OWL_LDB_CORPUSUSER||YES|Network Rail CORPUS API Username|
|
||||||
|OWL_LDB_CORPUSPASS||YES|Network Rail CORPUS API Password|
|
|OWL_LDB_CORPUSPASS||YES|Network Rail CORPUS API Password|
|
||||||
|OWL_GIT_ISSUEBOT||NO|Gitea API Key for issue reporting|
|
|OWL_GIT_ISSUEBOT||NO|Gitea API Key for issue reporting|
|
||||||
|
|OWL_GIT_APIENDPOINT||NO|Gitea API Endpoint|
|
||||||
|
|
||||||
In the case that OWL_LDB_SVKEY is not available, staff versions of departure board, etc. will not be available.
|
In the case that OWL_LDB_SVKEY is not available, staff versions of departure board, etc. will not be available.
|
||||||
|
|
||||||
|
21
src/services/issue.services.js
Normal file
21
src/services/issue.services.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
const axios = require('axios')
|
||||||
|
|
||||||
|
async function sendToGitea(body) {
|
||||||
|
let key = process.env.OWL_GIT_ISSUEBOT
|
||||||
|
let url = process.env.OWL_GIT_APIENDPOINT
|
||||||
|
let options = {
|
||||||
|
method: 'post',
|
||||||
|
timeout: 2000,
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
|
Authorization: key
|
||||||
|
},
|
||||||
|
data: body
|
||||||
|
}
|
||||||
|
|
||||||
|
await axios.post(url, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
sendToGitea
|
||||||
|
}
|
Reference in New Issue
Block a user