Move into /src folder

This commit is contained in:
Steven 2019-01-22 17:58:12 -05:00
parent 56f858049c
commit 95f9e99c54
11 changed files with 8 additions and 9 deletions

4
.gitignore vendored
View File

@ -1,5 +1,3 @@
node_modules node_modules
package-lock.json package-lock.json
dev.html dist
*.js.map
*.js

View File

@ -4,11 +4,11 @@
"version": 2, "version": 2,
"builds": [ "builds": [
{ "src": "public/*", "use": "@now/static" }, { "src": "public/*", "use": "@now/static" },
{ "src": "card.ts", "use": "@now/node@canary", "config": { "maxLambdaSize": "40mb" } } { "src": "src/card.ts", "use": "@now/node@canary", "config": { "maxLambdaSize": "40mb" } }
], ],
"routes": [ "routes": [
{ "src": "/", "dest": "/public/index.html" }, { "src": "/", "dest": "/public/index.html" },
{ "src": "/favicon.ico", "dest": "/public/favicon.ico" }, { "src": "/favicon.ico", "dest": "/public/favicon.ico" },
{ "src": "/(.+)", "dest": "/card.ts" } { "src": "/(.+)", "dest": "/src/card.ts" }
] ]
} }

View File

@ -2,9 +2,9 @@
"name": "og-image", "name": "og-image",
"version": "1.0.0", "version": "1.0.0",
"description": "Generate an open graph image for twitter/facebook/etc", "description": "Generate an open graph image for twitter/facebook/etc",
"main": "card.js", "main": "dist/card.js",
"scripts": { "scripts": {
"start": "node card.js", "start": "node dist/card.js",
"build": "tsc", "build": "tsc",
"watch": "tsc --watch" "watch": "tsc --watch"
}, },

View File

@ -4,8 +4,8 @@ import * as marked from 'marked';
import { sanitizeHtml } from './sanitizer'; import { sanitizeHtml } from './sanitizer';
function getCss(fontSize: string) { function getCss(fontSize: string) {
const regular = readFileSync(`${__dirname}/fonts/Inter-UI-Regular.woff2`).toString('base64'); const regular = readFileSync(`${__dirname}/../fonts/Inter-UI-Regular.woff2`).toString('base64');
const bold = readFileSync(`${__dirname}/fonts/Inter-UI-Bold.woff2`).toString('base64'); const bold = readFileSync(`${__dirname}/../fonts/Inter-UI-Bold.woff2`).toString('base64');
return ` return `
@font-face { @font-face {
font-family: 'Inter UI'; font-family: 'Inter UI';

View File

View File

@ -1,5 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"outDir": "dist",
"module": "commonjs", "module": "commonjs",
"target": "esnext", "target": "esnext",
"moduleResolution": "node", "moduleResolution": "node",