Commit d43e73c547b54ad1b9f250da0e06562553fdd203
Upgrades to now v2
Rômulo Alves committed on 12/1/2018, 1:27:58 PMParent: f20766fcd63c17fd9526329e92ea3e92f42b26ac
Files changed
next.config.js | changed |
now.json | changed |
package-lock.json | changed |
package.json | changed |
pages/_app.js | changed |
pages/_document.js | changed |
.dockerignore | deleted |
.nowignore | added |
Dockerfile | deleted |
.well-known/dat | added |
server.js | deleted |
next.config.js | ||
---|---|---|
@@ -1,3 +1,1 @@ | ||
1 | -const withOffline = require('next-offline'); | |
2 | - | |
3 | -module.exports = withOffline(); | |
1 … | +module.exports = {}; |
now.json | ||
---|---|---|
@@ -1,10 +1,28 @@ | ||
1 | 1 … | { |
2 … | + "version": 2, | |
2 | 3 … | "name": "plainbudget", |
3 | - "type": "docker", | |
4 | - "features": { | |
5 | - "cloud": "v2" | |
6 | - }, | |
7 | 4 … | "alias": [ |
8 | 5 … | "plainbudget.now.sh" |
6 … | + ], | |
7 … | + "env": { | |
8 … | + "NODE_ENV": "production" | |
9 … | + }, | |
10 … | + "builds": [ | |
11 … | + { "src": "next.config.js", "use": "@now/next" }, | |
12 … | + { "src": ".well-known/*", "use": "@now/static" } | |
13 … | + ], | |
14 … | + "routes": [ | |
15 … | + { | |
16 … | + "src": "/.well-known/(.*)", | |
17 … | + "dest": "/.well-known/$1", | |
18 … | + "headers": { | |
19 … | + "content-type": "text/plain", | |
20 … | + "content-disposition": "inline; filename=\"$1\"" | |
21 … | + } | |
22 … | + }, | |
23 … | + { | |
24 … | + "src": "/(.*)", | |
25 … | + "dest": "/$1" | |
26 … | + } | |
9 | 27 … | ] |
10 | 28 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 259316 bytes New file size: 221841 bytes |
package.json | ||
---|---|---|
@@ -1,31 +1,32 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "plainbudget-next", |
3 | 3 … | "version": "1.0.0", |
4 | - "description": "", | |
5 | 4 … | "main": "index.js", |
6 | 5 … | "scripts": { |
7 | - "dev": "IS_DEVELOPMENT=true node server.js", | |
6 … | + "dev": "next", | |
8 | 7 … | "build": "next build", |
9 | - "start": "node server.js" | |
8 … | + "start": "next start", | |
9 … | + "export": "npm run build && next export" | |
10 | 10 … | }, |
11 | 11 … | "repository": { |
12 | 12 … | "type": "git", |
13 | 13 … | "url": "git+https://github.com/romuloalves/plainbudget-next.git" |
14 | 14 … | }, |
15 | - "author": "", | |
16 | - "license": "ISC", | |
15 … | + "author": { | |
16 … | + "name": "Rômulo Alves", | |
17 … | + "email": "me@romuloalv.es", | |
18 … | + "url": "https://romuloalv.es" | |
19 … | + }, | |
20 … | + "license": "MIT", | |
17 | 21 … | "bugs": { |
18 | 22 … | "url": "https://github.com/romuloalves/plainbudget-next/issues" |
19 | 23 … | }, |
20 | 24 … | "homepage": "https://github.com/romuloalves/plainbudget-next#readme", |
21 | 25 … | "dependencies": { |
22 | - "compression": "1.7.3", | |
23 | - "express": "4.16.3", | |
24 | - "next": "6.1.1", | |
25 | - "next-offline": "2.11.0", | |
26 … | + "next": "^7.0.2", | |
26 | 27 … | "plainbudget": "1.0.0", |
27 | 28 … | "prop-types": "15.6.2", |
28 | - "react": "16.4.2", | |
29 | - "react-dom": "16.4.2" | |
29 … | + "react": "^16.6.3", | |
30 … | + "react-dom": "^16.6.3" | |
30 | 31 … | } |
31 | 32 … | } |
pages/_app.js | ||
---|---|---|
@@ -1,5 +1,6 @@ | ||
1 | 1 … | import App, { Container } from 'next/app'; |
2 … | +import Head from 'next/head'; | |
2 | 3 … | import React from 'react'; |
3 | 4 … | |
4 | 5 … | import { isMobile } from '../utils/mobile'; |
5 | 6 … | |
@@ -23,8 +24,11 @@ | ||
23 | 24 … | const { Component, pageProps } = this.props; |
24 | 25 … | |
25 | 26 … | return ( |
26 | 27 … | <Container> |
28 … | + <Head> | |
29 … | + <title>plainbudget</title> | |
30 … | + </Head> | |
27 | 31 … | <Component { ...pageProps } /> |
28 | 32 … | </Container> |
29 | 33 … | ); |
30 | 34 … | } |
pages/_document.js | ||
---|---|---|
@@ -10,9 +10,8 @@ | ||
10 | 10 … | render() { |
11 | 11 … | return ( |
12 | 12 … | <html lang="en"> |
13 | 13 … | <Head> |
14 | - <title>plainbudget</title> | |
15 | 14 … | <meta name="viewport" content="initial-scale=1.0, width=device-width" /> |
16 | 15 … | <link rel="manifest" href="/static/manifest.json" /> |
17 | 16 … | |
18 | 17 … | <meta name="mobile-web-app-capable" content="yes" /> |
.dockerignore | ||
---|---|---|
@@ -1,8 +1,0 @@ | ||
1 | -* | |
2 | -!components/ | |
3 | -!pages/ | |
4 | -!utils/ | |
5 | -!static/ | |
6 | -!next.config.js | |
7 | -!server.js | |
8 | -!package*.json |
Dockerfile | ||
---|---|---|
@@ -1,13 +1,0 @@ | ||
1 | -FROM mhart/alpine-node:10 as base | |
2 | -WORKDIR /usr/src | |
3 | -COPY package*.json /usr/src/ | |
4 | -RUN npm ci | |
5 | -COPY . . | |
6 | -RUN npm run build && npm install --production | |
7 | - | |
8 | -FROM mhart/alpine-node:base-10 | |
9 | -WORKDIR /usr/src | |
10 | -ENV NODE_ENV="production" | |
11 | -COPY --from=base /usr/src . | |
12 | -EXPOSE 3000 | |
13 | -CMD ["node", "server.js"] |
.well-known/dat | ||
---|---|---|
@@ -1,0 +1,2 @@ | ||
1 … | +dat://352a5c015d2fcca2835f9476e63c7d6795e4a2581dc1d9c5cfd6b68b8707f0f4 | |
2 … | +TTL=3600 |
server.js | ||
---|---|---|
@@ -1,33 +1,0 @@ | ||
1 | -const next = require('next'); | |
2 | -const express = require('express'); | |
3 | -const compression = require('compression'); | |
4 | -const { join } = require('path'); | |
5 | - | |
6 | -const dev = process.env.IS_DEVELOPMENT || false; | |
7 | -const port = process.env.PORT || 3000; | |
8 | - | |
9 | -const app = next({ dev }); | |
10 | -const handle = app.getRequestHandler(); | |
11 | - | |
12 | -app.prepare() | |
13 | - .then(function() { | |
14 | - const server = express(); | |
15 | - | |
16 | - if (!dev) { | |
17 | - server.use(compression()); | |
18 | - } | |
19 | - | |
20 | - server.get('/service-worker.js', function(request, response) { | |
21 | - const filePath = join(__dirname, '.next', 'service-worker.js'); | |
22 | - | |
23 | - return app.serveStatic(request, response, filePath); | |
24 | - }); | |
25 | - | |
26 | - server.get('*', function(request, response) { | |
27 | - return handle(request, response); | |
28 | - }); | |
29 | - | |
30 | - server.listen(port, function() { | |
31 | - console.log(`> Ready on http://localhost:${port}`); | |
32 | - }); | |
33 | - }); |
Built with git-ssb-web