Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
fixup! feat(hapi): upgrade to Hapi v17
Browse files Browse the repository at this point in the history
  • Loading branch information
CaerusKaru committed Jun 9, 2018
1 parent 773bfeb commit de8eb2d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/express-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@angular/common": "NG_VERSION",
"@angular/core": "NG_VERSION",
"@angular/platform-server": "NG_VERSION",
"express": "^4.15.2"
"express": "EXPRESS_VERSION"
},
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
Expand Down
8 changes: 4 additions & 4 deletions modules/hapi-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is a Hapi Engine for running Angular Apps on the server for server side ren
To use it, set the engine and then route requests to it

```ts
import { ResponseToolkit, Request, Server } from 'hapi';
import { Request, Server } from 'hapi';
import { ngHapiEngine } from '@nguniversal/hapi-engine';

const server = new Server();
Expand All @@ -21,7 +21,7 @@ server.connection({
server.route({
method: 'GET',
path: '/{path*}',
handler: (req: Request, h: ResponseToolkit) => ngHapiEngine({req, bootstrap: ServerAppModule})
handler: (req: Request) => ngHapiEngine({req, bootstrap: ServerAppModule})
});
```

Expand All @@ -34,7 +34,7 @@ is called. To do so, simply pass in a `url` and/or `document` string to the rend
server.route({
method: 'GET',
path: '/{path*}',
handler: (req: Request, h: ResponseToolkit) => {
handler: (req: Request) => {
const url = 'http://someurl.com';
const document = '<html><head><title>New doc</title></head></html>';
return ngHapiEngine({
Expand Down Expand Up @@ -69,7 +69,7 @@ The Bootstrap module as well as more providers can be passed on request
server.route({
method: 'GET',
path: '/{path*}',
handler: (req: Request, h: ResponseToolkit) =>
handler: (req: Request) =>
ngHapiEngine({
bootstrap: OtherServerAppModule,
providers: [
Expand Down
2 changes: 1 addition & 1 deletion modules/hapi-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@angular/common": "NG_VERSION",
"@angular/core": "NG_VERSION",
"@angular/platform-server": "NG_VERSION",
"hapi": "^17.0.0"
"hapi": "HAPI_VERSION"
},
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
Expand Down
10 changes: 7 additions & 3 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ DEFAULT_NODE_MODULES = "//:node_modules"

NG_VERSION = "^6.0.0-rc.0"
RXJS_VERSION = "^6.0.0-beta.0"
HAPI_VERSION = "^17.0.0"
EXPRESS_VERSION = "^4.15.2"

NGUNIVERSAL_SCOPED_PACKAGES = ["@nguniversal/%s" % p for p in [
"aspnetcore-engine",
Expand All @@ -20,6 +22,8 @@ NGUNIVERSAL_SCOPED_PACKAGES = ["@nguniversal/%s" % p for p in [
PKG_GROUP_REPLACEMENTS = {
"NG_VERSION": NG_VERSION,
"RXJS_VERSION": RXJS_VERSION,
"HAPI_VERSION": HAPI_VERSION,
"EXPRESS_VERSION": EXPRESS_VERSION,
"\"NG_UPDATE_PACKAGE_GROUP\"": """[
%s
]""" % ",\n ".join(["\"%s\"" % s for s in NGUNIVERSAL_SCOPED_PACKAGES])
Expand All @@ -39,14 +43,14 @@ GLOBALS = {
"@nguniversal/express-engine/tokens": "nguniversal.expressEngine.tokens",
"@nguniversal/hapi-engine/tokens": "nguniversal.hapiEngine.tokens",
'tslib': 'tslib',
"rxjs": "Rx",
"rxjs/operators": "Rx.operators",
"rxjs": "rxjs",
"rxjs/operators": "rxjs.operators",
"fs": "fs",
"express": "express",
"hapi": "hapi"
}

# TODO: when a better api for defaults is avilable use that isntead of these macros
# TODO(Toxicable): when a better api for defaults is avilable use that instead of these macros
def ts_test_library(node_modules=None, **kwargs):
ts_library(testonly=1, **kwargs)

Expand Down

0 comments on commit de8eb2d

Please sign in to comment.