Guest User

Untitled

a guest
Oct 21st, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. http://localhost:8080/dashboard
  2. http://localhost:8080/heroes
  3. http://localhost:8080/detail/13
  4.  
  5. <!doctype html>
  6. <html>
  7. <head>
  8. <base href="/">
  9. <meta charset="utf-8">
  10. <title>Tour of Heroes</title>
  11.  
  12. import { NgModule } from '@angular/core';
  13. import { HttpModule } from '@angular/http';
  14. import { LocationStrategy, HashLocationStrategy } from '@angular/common';
  15. import { RouterModule } from '@angular/router';
  16. import { AppComponent } from './app.component';
  17.  
  18. @NgModule({
  19. declarations: [
  20. AppComponent,
  21. ...
  22. ],
  23. imports: [
  24. HttpModule,
  25. RouterModule,
  26. ...
  27. ],
  28. providers: [
  29. ...,
  30. {provide: LocationStrategy, useClass: HashLocationStrategy}
  31. ],
  32. bootstrap: [AppComponent]
  33. })
  34.  
  35. export class AppModule { }
  36.  
  37. location / {
  38. root /home/jan/tour-of-heroes/;
  39. index index.html index.htm;
  40. }
  41.  
  42. error_page 404 =200 /index.html;
  43.  
  44. pushstate-server /home/jan/tour-of-heroes
  45.  
  46. node express.js
  47.  
  48. var express = require('express'),
  49. path = require('path'),
  50. port = process.env.PORT || 8083,
  51. app = express();
  52.  
  53.  
  54. app.use(express.static(__dirname ));
  55.  
  56.  
  57. app.get('*', function(request, response){
  58. response.sendFile(path.join(__dirname + '/index.html'));
  59. });
  60.  
  61. app.listen(port);
  62. console.log("server started on port " + port + ' at ' + __dirname + '/index.html');
  63.  
  64. node http-server/bin/http-server /home/jan/tour-of-heroes
  65.  
  66. live-server --entry-file=index.html /home/jan/tour-of-heroes
  67.  
  68. ng serve -prod
  69.  
  70. ng serve -prod -aot
Add Comment
Please, Sign In to add comment