listen(path, port, callback) {
		const parser = bodyParser.json({
			verify: function (req, res, buf, encoding) {
				req.rawBody = buf.toString(encoding);
			}
		});
		const server = http.createServer((req, res) => {
			const signature = req.headers['x-line-signature']; // Must be lowercase
			res.setHeader('X-Powered-By', 'LineBot');
			if (req.method === 'POST' && req.url === path) {
				parser(req, res, () => {
					if (this.options.verify && !this.verify(req.rawBody, signature)) {
						res.statusCode = 400;
						res.setHeader('Content-Type', 'text/html; charset=utf-8');
						return res.end('Bad request');
					}
					this.parse(req.body);
					res.statusCode = 200;
					res.setHeader('Content-Type', 'application/json');
					return res.end('{}');
				});
			} else {
				res.statusCode = 404;
				res.setHeader('Content-Type', 'text/html; charset=utf-8');
				return res.end('Not found');
			}
		});
		return server.listen(port, callback);
	}
// Optional built-in http server

Optional built-in http server
Optional built - in http server
listen(path, port, callback) {
		const parser = bodyParser.json({
			verify: function (req, res, buf, encoding) {
				req.rawBody = buf.toString(encoding);
			}
		});
		const server = http.createServer((req, res) => {
			const signature = req.headers['x-line-signature']; 
			res.setHeader('X-Powered-By', 'LineBot');
			if (req.method === 'POST' && req.url === path) {
				parser(req, res, () => {
					if (this.options.verify && !this.verify(req.rawBody, signature)) {
						res.statusCode = 400;
						res.setHeader('Content-Type', 'text/html; charset=utf-8');
						return res.end('Bad request');
					}
					this.parse(req.body);
					res.statusCode = 200;
					res.setHeader('Content-Type', 'application/json');
					return res.end('{}');
				});
			} else {
				res.statusCode = 404;
				res.setHeader('Content-Type', 'text/html; charset=utf-8');
				return res.end('Not found');
			}
		});
		return server.listen(port, callback);
	}
listen ( path , port , callback ) { const parser = bodyParser . json ( { verify : function ( req , res , buf , encoding ) { req . rawBody = buf . toString ( encoding ) ; } } ) ; const server = http . createServer ( ( req , res ) => { const signature = req . headers [ 'x-line-signature' ] ; res . setHeader ( 'X-Powered-By' , 'LineBot' ) ; if ( req . method === 'POST' && req . url === path ) { parser ( req , res , ( ) => { if ( this . options . verify && ! this . verify ( req . rawBody , signature ) ) { res . statusCode = 400 ; res . setHeader ( 'Content-Type' , 'text/html; charset=utf-8' ) ; return res . end ( 'Bad request' ) ; } this . parse ( req . body ) ; res . statusCode = 200 ; res . setHeader ( 'Content-Type' , 'application/json' ) ; return res . end ( '{}' ) ; } ) ; } else { res . statusCode = 404 ; res . setHeader ( 'Content-Type' , 'text/html; charset=utf-8' ) ; return res . end ( 'Not found' ) ; } } ) ; return server . listen ( port , callback ) ; }
Optional built-in http server
Optional built - in http server
// Must be lowercase
