File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ /// <reference path="../express/express.d.ts" />
3
+ /// <reference path="./express-useragent.d.ts" />
4
+
5
+ import express = require( "express" ) ;
6
+ import useragent = require( "express-useragent" ) ;
7
+
8
+ var app = express ( ) ;
9
+ app . use ( useragent . express ( ) ) ;
10
+ app . get ( "/" , function ( req , res ) {
11
+ var userAgentString =
12
+ "isMobile:" + req . useragent . isMobile + "," +
13
+ "isDesktop:" + req . useragent . isDesktop + "," +
14
+ "isBot:" + req . useragent . isDesktop + "," +
15
+ "browser:" + req . useragent . isDesktop + "," +
16
+ "version:" + req . useragent . isDesktop + "," +
17
+ "os:" + req . useragent . isDesktop + "," +
18
+ "platform:" + req . useragent . isDesktop + "," +
19
+ "source :" + req . useragent . isDesktop ;
20
+
21
+ res . end ( userAgentString ) ;
22
+ } ) ;
You can’t perform that action at this time.
0 commit comments