mirror of
https://github.com/sasjs/server.git
synced 2026-01-09 15:30:05 +00:00
feat: add views and styles for rendering html
This commit is contained in:
0
public/styles.css
Normal file
0
public/styles.css
Normal file
@@ -1,5 +1,10 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { processSas, createFileTree, getTreeExample } from '../controllers'
|
import {
|
||||||
|
processSas,
|
||||||
|
createFileTree,
|
||||||
|
getTreeExample,
|
||||||
|
sasjsExecutor
|
||||||
|
} from '../controllers'
|
||||||
import { ExecutionResult, isRequestQuery, isFileTree } from '../types'
|
import { ExecutionResult, isRequestQuery, isFileTree } from '../types'
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
@@ -50,7 +55,10 @@ router.post('/deploy', async (req, res) => {
|
|||||||
|
|
||||||
// TODO: respond with HTML page including file tree
|
// TODO: respond with HTML page including file tree
|
||||||
router.get('/SASjsExecutor', async (req, res) => {
|
router.get('/SASjsExecutor', async (req, res) => {
|
||||||
res.status(200).send({ status: 'success', tree: {} })
|
const tree = sasjsExecutor()
|
||||||
|
// res.status(200).send({ status: 'success', tree })
|
||||||
|
console.log(tree)
|
||||||
|
res.render('index', { tree })
|
||||||
})
|
})
|
||||||
|
|
||||||
router.get('/SASjsExecutor/do', async (req, res) => {
|
router.get('/SASjsExecutor/do', async (req, res) => {
|
||||||
|
|||||||
10
src/views/index.pug
Normal file
10
src/views/index.pug
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
extends layout
|
||||||
|
|
||||||
|
block layout-content
|
||||||
|
div
|
||||||
|
h1 SASJS Executor
|
||||||
|
div
|
||||||
|
ul
|
||||||
|
li= tree.name
|
||||||
|
each item in tree.children
|
||||||
|
li= item.name
|
||||||
13
src/views/layout.pug
Normal file
13
src/views/layout.pug
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
block variables
|
||||||
|
doctype html
|
||||||
|
html
|
||||||
|
head
|
||||||
|
meta(charset="utf-8")
|
||||||
|
meta(name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
|
||||||
|
meta(name="theme-color", content="#000000")
|
||||||
|
link(rel="shortcut icon", href="/favicon.ico")
|
||||||
|
link(rel="stylesheet" href="/styles.css")
|
||||||
|
title SASJS Executor
|
||||||
|
body
|
||||||
|
div#root
|
||||||
|
block layout-content
|
||||||
Reference in New Issue
Block a user