mirror of
https://github.com/directus/directus.git
synced 2026-01-28 18:18:10 -05:00
Merge pull request #28 from directus/fix-static-admin
Fix admin app not returned from api
This commit is contained in:
@@ -55,15 +55,16 @@ if (env.CORS_ENABLED === 'true') {
|
||||
);
|
||||
}
|
||||
|
||||
const adminPath = require.resolve('@directus/app/dist/index.html');
|
||||
|
||||
app.get('/', (req, res) => res.redirect('/admin/'))
|
||||
|
||||
// the auth endpoints allow you to login/logout etc. It should ignore the authentication check
|
||||
.use('/admin', express.static(path.join(__dirname, '../node_modules', '@directus/app/dist')))
|
||||
.use('/admin/*', (req, res) =>
|
||||
res.sendFile(path.join(__dirname, '../node_modules', '@directus/app/dist/index.html'))
|
||||
)
|
||||
.use('/admin', express.static(path.join(adminPath, '..')))
|
||||
.use('/admin/*', (req, res) => {
|
||||
res.sendFile(adminPath);
|
||||
});
|
||||
|
||||
.use('/auth', authRouter)
|
||||
app.use('/auth', authRouter)
|
||||
|
||||
.use(authenticate)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"private": false,
|
||||
"description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases",
|
||||
"author": "Rijk van Zanten <rijk@rngr.org>",
|
||||
"main": "dist/index.html",
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE",
|
||||
|
||||
Reference in New Issue
Block a user