mirror of
https://github.com/directus/directus.git
synced 2026-01-24 02:27:56 -05:00
Add Makefile to bundle in app
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ uploads
|
||||
debug.db
|
||||
test
|
||||
dist
|
||||
tmp
|
||||
|
||||
6
Makefile
Normal file
6
Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
bundle:
|
||||
npm run build
|
||||
git clone git@github.com:directus/app-next.git tmp-app
|
||||
cd tmp-app && npm install && npm run build
|
||||
cp -r tmp-app/dist dist/admin
|
||||
rm -rf tmp-app
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "directus",
|
||||
"version": "0.0.1",
|
||||
"version": "0.1.0-preview.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
15
package.json
15
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "directus",
|
||||
"version": "0.0.1",
|
||||
"version": "0.1.0-preview.1",
|
||||
"description": "Directus",
|
||||
"main": "dist/server.js",
|
||||
"main": "dist/app.js",
|
||||
"bin": {
|
||||
"directus": "dist/cli/index.js"
|
||||
},
|
||||
@@ -10,12 +10,19 @@
|
||||
"start": "NODE_ENV=production node dist/server.js",
|
||||
"build": "rimraf dist && tsc -b && copyfiles \"src/**/*.*\" -e \"src/**/*.ts\" -u 1 dist",
|
||||
"dev": "NODE_ENV=development LOG_LEVEL=trace ts-node-dev --files src/server.ts --clear --respawn --watch \"src/**/*.ts\" --transpile-only | pino-colada",
|
||||
"cli": "NODE_ENV=development ts-node --script-mode --transpile-only src/cli/index.ts"
|
||||
"cli": "NODE_ENV=development ts-node --script-mode --transpile-only src/cli/index.ts",
|
||||
"prepublishOnly": "make bundle"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/directus/api-node.git"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"example.env"
|
||||
],
|
||||
"keywords": [
|
||||
"directus",
|
||||
"api",
|
||||
@@ -26,7 +33,7 @@
|
||||
"crm"
|
||||
],
|
||||
"author": "Rijk van Zanten <rijkvanzanten@me.com>",
|
||||
"license": "GPL-3.0",
|
||||
"license": "GPL-3.0-only",
|
||||
"bugs": {
|
||||
"url": "https://github.com/directus/api-node/issues"
|
||||
},
|
||||
|
||||
@@ -4,6 +4,7 @@ dotenv.config();
|
||||
import express from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import logger from 'express-pino-logger';
|
||||
import path from 'path';
|
||||
|
||||
import errorHandler from './middleware/error-handler';
|
||||
|
||||
@@ -44,6 +45,9 @@ const app = express()
|
||||
})
|
||||
|
||||
// the auth endpoints allow you to login/logout etc. It should ignore the authentication check
|
||||
.use('/admin', express.static(path.join(__dirname, 'admin')))
|
||||
.use('/admin/*', (req, res) => res.sendFile(path.join(__dirname, 'admin/index.html')))
|
||||
|
||||
.use('/auth', authRouter)
|
||||
|
||||
.use(authenticate)
|
||||
|
||||
Reference in New Issue
Block a user