Dotos 8 gadi atpakaļ
vecāks
revīzija
e556f88625
1 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 8 1
      app.js

+ 8 - 1
app.js

@@ -46,7 +46,7 @@ app.use(logger('combined', {
 }));
 //app.use(bodyParser.raw({ type: '*/*' }));
 app.use(bodyParser.json());
-app.use(bodyParser.urlencoded({ extended: false }));
+app.use(bodyParser.urlencoded({ extended: true }));
 app.use(cookieParser());
 app.use(helmet());
 //静态文件访问路径
@@ -117,6 +117,13 @@ app.use('/joke', joke);
 app.use('/mobile', mobile);
 app.use('/weather', weather);
 
+/**
+ * Robots.txt
+ */
+app.use('/robots.txt', function(req, res, next) {
+    res.header('content-type', 'text/plain');
+    res.send('User-Agent: * \nAllow: /');
+});
 
 // catch 404 and forward to error handler
 app.use(function(req, res, next) {