What this will cover
- Host a static website at S3
- Redirect
www.website.comtowebsite.com - Website can be an SPA (requiring all requests to return
index.html) - Free AWS SSL certs
- Deployment with CDN invalidation
| import { Pipe, PipeTransform } from '@angular/core'; | |
| @Pipe({name: 'list', pure: true}) | |
| export class ListPipe implements PipeTransform { | |
| transform(value: string[]): string { | |
| return value.join(', '); | |
| } | |
| } |
| import { NgModule } from '@angular/core'; | |
| import { SharedModule } from '../shared.module.ts'; | |
| import { ShoppingCartComponent } from './shopping-cart.component'; | |
| import { ShoppingItemComponent } from './shopping-item.component'; | |
| @NgModule({ | |
| declarations: [ | |
| ShoppingCartComponent, // Notice this component is also being exported below |
| @NgModule({ | |
| providers: [ | |
| ChartService, | |
| CovidService, | |
| ], | |
| }) | |
| export class CoreModule { } |
| @NgModule({ | |
| declarations: [AppComponent], | |
| imports: [ | |
| BrowserModule, | |
| BrowserAnimationsModule, | |
| CoreModule, | |
| ], | |
| exports: [CoreModule], | |
| bootstrap: [AppComponent] | |
| }) |
| const http = require('http') | |
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const morgan = require('morgan') | |
| const cors = require('cors') | |
| const app = module.exports = express() | |
| const server = http.createServer(app) | |
| const port = parseInt(process.env.PORT || 3000) | |
| app.use(bodyParser.json()) |
| const router = module.exports = require('express').Router(); | |
| router.get('/', teas}); | |
| router.get('/:id', getOneTea}); | |
| router.put('/:id', editTea}); | |
| router.post('/', addTea}); | |
| router.del('/:id', deleteTea}); | |
| function teas(req, res) { | |
| res.json({ data: teas }); |