Reputation: 63
I tried to setup project mentioned at this github location https://github.com/RamEduard/admin-lte-express I created a sample express application where files are like this:-
Package.json
{
"name": "apr27",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"admin-lte-express": "^1.4.2",
"express": "^4.16.3"
}
}
Index.js
const express = require('express')
const app = express()
app.use('/admin', express.static('./node_modules/admin-lte-express/public'))
app.use('/', require('admin-lte-express'));
app.listen(3001, () => console.log('Example app listening on port 3001!'))
when I hit server localhost:3000, It returns me error page. Can anybody help me why it is happening and what is correct way to do it
Upvotes: 1
Views: 4000
Reputation: 537
You can follow the below steps:
npm install admin-lte
app.use('/admin', express.static('./node_modules/admin-lte'));
Upvotes: 2