express-tsx
Advanced tools
Comparing version 4.0.6 to 4.0.7
{ | ||
"name": "express-tsx", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"description": "express view engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -18,5 +18,5 @@ | ||
const server = express() | ||
server.listen(9000,function(){ console.log(`server is running on ${this.addresss().port}`) }) | ||
server.listen(9000,function(){ console.log(`server is running on ${this.address().port}`) }) | ||
//设定视图引擎 | ||
server.engie('.tsx',require('express-tsx').render) | ||
server.engine('.tsx',require('express-tsx').render) | ||
server.set('views',__dirname) | ||
@@ -27,3 +27,3 @@ server.set('view engie','tsx')//选择视图引擎 | ||
//渲染视图 | ||
server.ues('/',(req,res)=>res.render('./view.tsx')) | ||
server.use('/',(req,res)=>res.render('./view.tsx')) | ||
``` | ||
@@ -33,3 +33,3 @@ - [视图文件](./example/view.tsx) | ||
import React = require('react') | ||
alert('express-tsx' as any) | ||
console.log('express-tsx' as any) | ||
export default ()=> | ||
@@ -46,15 +46,7 @@ <div> | ||
``` | ||
- 安装依赖 | ||
```shell | ||
npm install | ||
``` | ||
- 进入示例目录 | ||
- 安装依赖 ; 进入示例目录 ; 运行 | ||
```shell | ||
cd example | ||
cd example ; npm install ; npm start | ||
``` | ||
- 运行 | ||
```shell | ||
npm start | ||
``` | ||
- 在浏览器中打开 [示例:http://127.0.0.1:9000/](http://127.0.0.1:9000/) | ||
一切正常的话会看到 : `hello world` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51572
48