mirror of
https://github.com/bckelley/Sass-Workflow.git
synced 2026-08-24 03:24:12 -05:00
* added proxy-middleware * added express server had to add the express server to see the files in my directory and proxy-middleware to get gulp and browser-sync to work
45 lines
1.4 KiB
HTML
45 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html class="no-js" lang="en">
|
|
<head>
|
|
<title>Sass Workflow</title>
|
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<!--<link rel="stylesheet" href="../dist/css/style.css">//-->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Sass Workflow</h1>
|
|
<p>Edit the scss/style.scss file and it will automatically compile into css/style.css</p>
|
|
|
|
<ul id="fileList"></ul>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
fetch('/api/files')
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
/* console.log(data) */
|
|
const fileList = document.getElementById('fileList')
|
|
if ( Array.isArray(data.files) ) {
|
|
data.files.forEach(file => {
|
|
const li = document.createElement('li')
|
|
const a = document.createElement('a')
|
|
a.href = `/src/edits/${file}`
|
|
a.textContent = file
|
|
li.appendChild(a)
|
|
fileList.appendChild(li)
|
|
});
|
|
} else {
|
|
console.error("Expected 'files' to be an array, but got:", data.files);
|
|
}
|
|
})
|
|
.catch(err => {
|
|
console.error("[ ERR ]: Error fetching file list: ", err)
|
|
})
|
|
})
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |