Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const router = express.Router();
- const dirTree = require("directory-tree");
- router.get("/:filePath", (req, res, next) => {
- const path = req.params.filePath
- const tPath = path.replace("+","/")
- const tree = dirTree(`/home/cameron/TestRestApi/api/stoage/${tPath}`);
- res.status(200).json(tree)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement