Skip to content

Commit

Permalink
chore: switch to app.static for home page
Browse files Browse the repository at this point in the history
Signed-off-by: Raymond Feng <enjoyjava@gmail.com>
  • Loading branch information
djambo05 committed Nov 9, 2018
1 parent 2b68158 commit 02f4852
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 235 deletions.
340 changes: 164 additions & 176 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,34 @@
"src"
],
"dependencies": {
"@loopback/boot": "^1.0.2",
"@loopback/context": "^1.0.0",
"@loopback/core": "^1.0.0",
"@loopback/openapi-v3": "^1.0.2",
"@loopback/repository": "^1.0.2",
"@loopback/rest": "^1.1.0",
"@loopback/service-proxy": "^1.0.0",
"@loopback/boot": "^1.0.3",
"@loopback/context": "^1.0.1",
"@loopback/core": "^1.0.1",
"@loopback/openapi-v3": "^1.1.0",
"@loopback/repository": "^1.0.3",
"@loopback/rest": "^1.2.0",
"@loopback/service-proxy": "^1.0.1",
"bcryptjs": "^2.4.3",
"debug": "^4.1.0",
"express": "^4.16.4",
"isemail": "^3.2.0",
"lodash": "^4.17.11",
"loopback-connector-kv-redis": "^3.0.0",
"loopback-connector-mongodb": "^3.9.1",
"loopback-connector-mongodb": "^3.9.2",
"loopback-connector-rest": "^3.4.1"
},
"devDependencies": {
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"@commitlint/travis-cli": "^7.2.1",
"@loopback/build": "^1.0.0",
"@loopback/testlab": "^1.0.0",
"@loopback/build": "^1.0.1",
"@loopback/testlab": "^1.0.1",
"@types/bcryptjs": "^2.4.2",
"@types/debug": "0.0.31",
"@types/express": "^4.16.0",
"@types/lodash": "^4.14.117",
"@types/lodash": "^4.14.118",
"@types/mocha": "^5.0.0",
"@types/node": "^10.12.2",
"@types/node": "^10.12.3",
"commitizen": "^3.0.4",
"concurrently": "^4.0.1",
"cz-conventional-changelog": "^2.1.0",
Expand Down
6 changes: 3 additions & 3 deletions public/index.html.template → public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">

<head>
<title>${description}</title>
<title>LoopBack 4 Example: Online Shopping APIs</title>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -56,8 +56,8 @@

<body>
<div class="info">
<h1>${name}</h1>
<p>Version ${version}</p>
<h1>$@loopback/example-shopping</h1>
<p>Version 1.0.0</p>

<h3>OpenAPI spec: <a href="/openapi.json">/openapi.json</a></h4>
<h3>API Explorer: <a href="/explorer">/explorer</a></h4>
Expand Down
4 changes: 4 additions & 0 deletions src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {RepositoryMixin} from '@loopback/repository';
import {RestApplication} from '@loopback/rest';
import {ServiceMixin} from '@loopback/service-proxy';
import {MySequence} from './sequence';
import * as path from 'path';

/**
* Information from package.json
Expand All @@ -34,6 +35,9 @@ export class ShoppingApplication extends BootMixin(
// Set up the custom sequence
this.sequence(MySequence);

// Set up default home page
this.static('/', path.join(__dirname, '../../public'));

this.projectRoot = __dirname;
// Customize @loopback/boot Booter Conventions here
this.bootOptions = {
Expand Down
43 changes: 0 additions & 43 deletions src/controllers/home-page.controller.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/controllers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
export * from './ping.controller';
export * from './user.controller';
export * from './shopping-cart.controller';
export * from './home-page.controller';
export * from './user-order.controller';
File renamed without changes.
1 change: 1 addition & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--recursive
--exit
--require source-map-support/register

0 comments on commit 02f4852

Please sign in to comment.