UX and code

master
glmdev 4 years ago
parent 2a80e65c35
commit 2b95fc17a6
  1. 4
      app/MiscUnit.js
  2. 2
      app/controllers/dash/v1.controller.js
  3. 4
      app/routing/Middleware.js
  4. 26
      app/routing/middleware/Debug.middleware.js
  5. 8
      app/views/dash_v1/code.pug
  6. 2
      app/views/dash_v1/template.pug

@ -37,6 +37,10 @@ class MiscUnit extends Unit {
global.devbug = {
version: '0.2.0',
code: {
node: `dbsetup({
\tserver: "https://CHANGEME:8000/", // DevBug Server URL
\tproject: "CHANGEME", // Project API Key
})`,
php: `<?php
// ===========================================================
// DEVBUG INLINE DEBUGGING HELPER - FOR USE WITH DEVBUG SERVER

@ -182,7 +182,7 @@ class v1 {
}
view_code(req, res, next){
return _flitter.view(res, 'dash_v1:code', { user: req.session.auth.user, title: 'Inline Code Snippets' })
return _flitter.view(res, 'dash_v1:code', { user: req.session.auth.user, title: 'Using DevBug Inline' })
}
async project_share_show(req, res, next){

@ -11,8 +11,8 @@
*/
const Middleware = [
// mw('MiddlewareName'),
'Debug',
]
module.exports = exports = Middleware
module.exports = exports = Middleware

@ -0,0 +1,26 @@
/*
* Debug Middleware
* -------------------------------------------------------------
* Put some description here!
*/
class Debug {
/*
* Run the middleware test.
* This method is required by all Flitter middleware.
* It should either call the next function in the stack,
* or it should handle the response accordingly.
*/
test(req, res, next, args = {}){
console.log('DEBUGGING LAYER:')
console.log('Incoming destination: '+req.originalUrl)
console.log('Incoming method: '+req.method)
/*
* Call the next function in the stack.
*/
next()
}
}
module.exports = Debug

@ -6,10 +6,14 @@ block content
| function. Then, call the
code breakpoint()
| function to send those outputs to DevBug.
h2 Node.js
p To use DevBug in a Node.js app, install the "devbugjs" NPM package. Then, to initialize DevBug, use the following code snippet at any point in the application:
pre
code #{devbug.code.node}
h2 PHP
p
| You'll need to ensure that the DevBug server URL and Project API Key are correct. These are local variables in the
code breakpoint()
code breakpoint()
| function.
h2 PHP
pre
code #{devbug.code.php}

@ -14,7 +14,7 @@ html
li.navli
a.nava(href='/dash/v1') Home
li.navli
a.nava(href='/dash/v1/code') Code Snippets
a.nava(href='/dash/v1/code') Using DevBug
li.navli
a.nava(href='/auth/logout') Logout
if show_back

Loading…
Cancel
Save