Skip to content

Commit

Permalink
fix(package.json): Add the .pug files manually to dist.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyTales committed Jun 9, 2017
1 parent 97e4034 commit a52358d
Show file tree
Hide file tree
Showing 4 changed files with 311 additions and 14 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
},
"scripts": {
"start": "nodemon dist/entry/standalone.js",
"watch": "tsc -w",
"build": "yarn lint && tsc",
"watch": "yarn copy-pug && tsc -w",
"build": "yarn lint && tsc && yarn copy-pug",
"cli": "node dist/entry/cli.js",
"standalone": "node dist/entry/standalone.js",
"lint": "tslint \"src/**/*.ts\" \"stubs/**/*.ts\"",
"semantic-release": "semantic-release pre && npm publish --access public && semantic-release post"
"semantic-release": "semantic-release pre && npm publish --access public && semantic-release post",
"copy-pug": "yarn copy src/admin/*.pug dist/admin/"
},
"devDependencies": {
"@types/body-parser": "^1.16.3",
Expand Down Expand Up @@ -48,6 +49,7 @@
"boom": "^5.1.0",
"bull": "^2.2.6",
"compose-middleware": "^2.2.0",
"copy": "^0.3.0",
"cors": "^2.8.3",
"dotenv": "^4.0.0",
"dotenv-extended": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const router: express.Router = express.Router();
router.get('/', wrapAsync(async (req, res, next) => {
const keys = await ApiKey.find({});

res.render('admin', { keys });
res.render('admin/admin', { keys });

next();
}));
Expand Down
3 changes: 2 additions & 1 deletion src/entry/app_standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as os from 'os';
import * as express from 'express';
import * as cors from 'cors';
import * as bodyParser from 'body-parser';
import * as path from 'path';
import * as morgan from 'morgan';
import './bootstrap';
import config from '../config';
Expand All @@ -22,7 +23,7 @@ const port = config.serverPort;

//=> Load the view engine Pug
app.set('view engine', 'pug');
app.set('views', './src/admin');
app.set('views', path.resolve(`${__dirname}/..`));

//=> Connect to the MongoDB database
connectDatabase(config.mongoUrl).catch((error) => {
Expand Down

0 comments on commit a52358d

Please sign in to comment.