Commit 04ef02f04bbaafcd2315aab58dd7be6cfaf19f8c
Upgrades to now v2
Rômulo Alves committed on 11/30/2018, 12:16:49 PMParent: 90f1fa10f4cf1eadad9cd3539872fd71cc183030
Files changed
next.config.js | changed |
now.json | changed |
package-lock.json | changed |
package.json | changed |
server.js | changed |
.dockerignore | deleted |
.nowignore | added |
Dockerfile | deleted |
next.config.js | ||
---|---|---|
@@ -1,10 +1,8 @@ | ||
1 | -const withPreact = require('@zeit/next-preact'); | |
2 | - | |
3 | -module.exports = withPreact({ | |
1 … | +module.exports = { | |
4 | 2 … | exportPathMap () { |
5 | 3 … | return { |
6 | 4 … | '/': { page: '/' }, |
7 | 5 … | '/talks': { page: '/talks' } |
8 | 6 … | } |
9 | 7 … | } |
10 | -}); | |
8 … | +}; |
now.json | ||
---|---|---|
@@ -1,12 +1,28 @@ | ||
1 | 1 … | { |
2 | - "version": 1, | |
2 … | + "version": 2, | |
3 | 3 … | "name": "romuloalv.es", |
4 | - "type": "static", | |
5 | 4 … | "alias": [ |
6 | 5 … | "romuloalv.es", |
7 | 6 … | "www.romuloalv.es" |
8 | 7 … | ], |
9 | - "env": { | |
10 | - "NODE_ENV": "production" | |
11 | - } | |
8 … | + "routes": [ | |
9 … | + { | |
10 … | + "src": "/.well-known/(.*)", | |
11 … | + "dest": "/.well-known/$1", | |
12 … | + "headers": { | |
13 … | + "content-type": "text/plain", | |
14 … | + "content-disposition": "inline; filename=\"dat\"" | |
15 … | + } | |
16 … | + } | |
17 … | + ], | |
18 … | + "builds": [ | |
19 … | + { | |
20 … | + "src": "package.json", | |
21 … | + "use": "@now/static-build" | |
22 … | + }, | |
23 … | + { | |
24 … | + "src": ".well-known/*", | |
25 … | + "use": "@now/static" | |
26 … | + } | |
27 … | + ] | |
12 | 28 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 230840 bytes New file size: 228172 bytes |
package.json | ||
---|---|---|
@@ -2,13 +2,10 @@ | ||
2 | 2 … | "name": "romuloalv.es", |
3 | 3 … | "version": "3.0.0", |
4 | 4 … | "description": "Rômulo Alves website", |
5 | 5 … | "dependencies": { |
6 | - "@zeit/next-preact": "^0.0.7", | |
7 | 6 … | "next": "^7.0.0", |
8 | 7 … | "nprogress": "^0.2.0", |
9 | - "preact": "^8.3.1", | |
10 | - "preact-compat": "^3.18.4", | |
11 | 8 … | "prop-types": "^15.6.2", |
12 | 9 … | "react": "^16.5.2", |
13 | 10 … | "react-dom": "^16.5.2", |
14 | 11 … | "time-ago": "^0.2.1" |
@@ -17,9 +14,10 @@ | ||
17 | 14 … | "scripts": { |
18 | 15 … | "dev": "NODE_ENV=development node server.js", |
19 | 16 … | "start": "node server.js", |
20 | 17 … | "build": "next build", |
21 | - "export": "next build && next export" | |
18 … | + "export": "next build && next export", | |
19 … | + "now-build": "npm run export -- -o dist" | |
22 | 20 … | }, |
23 | 21 … | "repository": { |
24 | 22 … | "type": "git", |
25 | 23 … | "url": "git+https://github.com/romuloalves/romuloalves.github.io.git" |
server.js | |||
---|---|---|---|
@@ -1,10 +1,6 @@ | |||
1 | 1 … | const dev = process.env.NODE_ENV !== 'production'; | |
2 | 2 … | ||
3 | -if (!dev) { | ||
4 | - require('@zeit/next-preact/alias')(); | ||
5 | -} | ||
6 | - | ||
7 | 3 … | const { createServer } = require('http'); | |
8 | 4 … | const { parse } = require('url'); | |
9 | 5 … | const { createReadStream } = require('fs'); | |
10 | 6 … | const { join } = require('path'); | |
@@ -17,9 +13,9 @@ | |||
17 | 13 … | app.prepare() | |
18 | 14 … | .then(() => { | |
19 | 15 … | createServer((req, res) => { | |
20 | 16 … | const parsedUrl = parse(req.url, true); | |
21 | - const { pathname, query } = parsedUrl; | ||
17 … | + const { pathname } = parsedUrl; | ||
22 | 18 … | ||
23 | 19 … | if (pathname === '/.well-known/dat') { | |
24 | 20 … | res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
25 | 21 … |
Built with git-ssb-web