amarzeet
amarzeet

Reputation: 63

how to setup admin-lte-express nodejs project

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

Answers (1)

Balasuresh Asaithambi
Balasuresh Asaithambi

Reputation: 537

You can follow the below steps:

1) Install admin lte via npm using

npm install admin-lte

2) Add this path in index.js or server.js

app.use('/admin', express.static('./node_modules/admin-lte'));

Upvotes: 2

Related Questions