Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efb8ebb
commit aa55dc4
Showing
4 changed files
with
66 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"private": true, | ||
"name": "typescript-example", | ||
"version": "0.0.0", | ||
"devDependencies": { | ||
"ts-node": "^8.0.3", | ||
"typescript": "^3.3.3333" | ||
}, | ||
"scripts": { | ||
"dev": "polydev --require ts-node/register", | ||
"prestart": "tsc", | ||
"start": "cd dist && NODE_ENV=production polydev" | ||
}, | ||
"dependencies": { | ||
"@types/express": "^4.16.1", | ||
"react": "^16.8.4", | ||
"react-dom": "^16.8.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Request, Response } from "express" | ||
import * as React from "react" | ||
import { renderToStaticMarkup } from "react-dom/server" | ||
|
||
let hits = 0 | ||
|
||
export default (req: Request, res: Response) => { | ||
hits++ | ||
|
||
res.send( | ||
renderToStaticMarkup( | ||
<> | ||
<link | ||
href="https://fonts.googleapis.com/css?family=Quicksand:300,500" | ||
rel="stylesheet" | ||
/> | ||
<link href="/_polydev/styles.css" rel="stylesheet" /> | ||
|
||
<div id="splash" /> | ||
|
||
<section> | ||
<main> | ||
<h1> | ||
👋 Howdy from <kbd>TypeScript</kbd> | ||
</h1> | ||
|
||
<p> | ||
<kbd>{hits}</kbd> {hits ? "hits" : "hit"} | ||
</p> | ||
</main> | ||
|
||
<footer> | ||
<a href="/">« Back</a> | ||
</footer> | ||
</section> | ||
</> | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"jsx": "react", | ||
"outDir": "dist", | ||
"rootDir": "." | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.