next.js, nginx, reverse-proxy, ssl
$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt
const emoji = require('remark-emoji') | |
const fs = require('fs') | |
const nextOffline = require('next-offline') | |
const path = require('path') | |
const withMDX = require('@zeit/next-mdx')({ | |
extension: /\.mdx?$/, | |
options: { mdPlugins: [emoji] } | |
}) | |
const withPlugins = require('next-compose-plugins') |
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants'); | |
const { withPlugins } = require('next-compose-plugins'); | |
const withManifest = require('next-manifest') | |
const withOffline = require('next-offline') | |
const forceProd = require('./forceProd') | |
const manifest = { | |
"short_name": "next-offline-test-app", | |
"name": "next-offline-test-app", | |
"description": "Reproduce a bug to help fix it", |
/********** | |
server.ts | |
--------------- | |
Simple file written in ES6 to serve a ExpressJS/NextJS Server. | |
Uses SSL, Compression, redirection and service worker routing. See server config file at : | |
https://github.com/glemiere/nextjs-starter/tree/master/config | |
--------------- | |
Requires Let's Encrypt SSL Certificate : | |
https://letsencrypt.org/ | |
**********/ |
import { Injectable, Injector } from '@angular/core'; | |
import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest, HttpEvent, HttpClient, HttpHeaders } from '@angular/common/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import { ErrorObservable } from 'rxjs/Observable/ErrorObservable'; | |
import { EmptyObservable } from 'rxjs/Observable/EmptyObservable'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
import { catchError, filter, take, switchMap, finalize } from "rxjs/operators"; | |
import { APIURL } from "../app/constants"; | |
import { UserService } from "./user/user.provider"; |
Use with the following
You must use this compontent on the route component where the form is shown not on the form component itself.
This is because this.props.route
is only added to route components, and I didn't want to pass that down through props.
Inspired by this Codepad
Feedback appreciated
// 12/22/2015 | |
// You might know some pretty large perfect squares. But what about the NEXT one? | |
// Complete the findNextSquare method that finds the next integral perfect square after the one passed as a parameter. Recall that | |
an integral perfect square is an integer n such that sqrt(n) is also an integer. | |
// If the parameter is itself not a perfect square, than -1 should be returned. You may assume the parameter is positive. | |
// Examples: | |
// findNextSquare(121) --> returns 144 | |
// findNextSquare(625) --> returns 676 |