This is my first nodeJS project that I'm working on. It's to build up my skill. It will get some updates, which will change the coding style and methods. I appreciate your feedback.
Add a new static direction in your ExpressJS app, which should look like this:
app.use(express.static(path.join(__dirname, 'themes')));Create the root folder for the themes in your root direction
├── app.js
├── bin
│ └── www
├── package-lock.json
├── package.json
├── public
│ ├── images
│ ├── javascripts
│ └── stylesheets
│ └── style.css
├── routes
│ ├── getThemeinformation.js
│ ├── index.js
│ └── users.js
├── themes <-- Here
└── views
├── error.ejs
└── index.ejs
Like this.
routes/index.js
const appRoot = require('app-root-path');
const getThemeInformation = require('./lib/searchThemes');
getThemeInformation(appRoot, 'themes').then((r) => {
res.render('index', { style: r.main });
});views/index.ejs
<link rel='stylesheet' href='<%= style %>' />This will load the selected Theme.
- Global theme config
- Javascript loader
- Webpack support
- Minimizer
- SCSS to CSS
If you find bugs please open an issue or create a Pull request.
This project is licensed under the MIT License.
I hope you enjoy this project :)