Move into /src folder
This commit is contained in:
parent
56f858049c
commit
95f9e99c54
|
@ -1,5 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
dev.html
|
dist
|
||||||
*.js.map
|
|
||||||
*.js
|
|
4
now.json
4
now.json
|
@ -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" }
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -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"
|
||||||
},
|
},
|
||||||
|
|
|
@ -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';
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"outDir": "dist",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
|
Loading…
Reference in New Issue