mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Change all "api" URLs. Ideally the path prefix would be an option.
This commit is contained in:
parent
436fa6eff9
commit
b2e114c9be
14 changed files with 28 additions and 29 deletions
|
@ -91,7 +91,7 @@ module.exports = function(options) {
|
|||
res.render('index')
|
||||
})
|
||||
|
||||
app.get('/api/v1/app/state.js', function(req, res) {
|
||||
app.get('/app/api/v1/state.js', function(req, res) {
|
||||
var state = {
|
||||
config: {
|
||||
websocketUrl: (function() {
|
||||
|
@ -106,14 +106,14 @@ module.exports = function(options) {
|
|||
res.send('var GLOBAL_APPSTATE = ' + JSON.stringify(state))
|
||||
})
|
||||
|
||||
app.get('/api/v1/app/user', function(req, res) {
|
||||
app.get('/app/api/v1/user', function(req, res) {
|
||||
res.json({
|
||||
success: true
|
||||
, user: req.user
|
||||
})
|
||||
})
|
||||
|
||||
app.get('/api/v1/app/group', function(req, res) {
|
||||
app.get('/app/api/v1/group', function(req, res) {
|
||||
dbapi.loadGroup(req.user.email)
|
||||
.then(function(cursor) {
|
||||
return Promise.promisify(cursor.toArray, cursor)()
|
||||
|
@ -135,7 +135,7 @@ module.exports = function(options) {
|
|||
})
|
||||
})
|
||||
|
||||
app.get('/api/v1/app/devices', function(req, res) {
|
||||
app.get('/app/api/v1/devices', function(req, res) {
|
||||
dbapi.loadDevices()
|
||||
.then(function(cursor) {
|
||||
return Promise.promisify(cursor.toArray, cursor)()
|
||||
|
@ -158,7 +158,7 @@ module.exports = function(options) {
|
|||
})
|
||||
})
|
||||
|
||||
app.get('/api/v1/app/devices/:serial', function(req, res) {
|
||||
app.get('/app/api/v1/devices/:serial', function(req, res) {
|
||||
dbapi.loadDevice(req.params.serial)
|
||||
.then(function(device) {
|
||||
if (device) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue