219 matches across 7 files for func main
snippet_mode: auto · sorted by relevance
lib/request.js JAVASCRIPT 32 matches · showing 5 view file →
62
63req.get =
64req.header = function header(name) {
65 if (!name) {
66 throw new TypeError('name argument is required to req.get');
· · ·
125 */
126
127req.accepts = function(){
128 var accept = accepts(this);
129 return accept.types.apply(accept, arguments);
· · ·
138 */
139
140req.acceptsEncodings = function(){
141 var accept = accepts(this);
142 return accept.encodings.apply(accept, arguments);
· · ·
169 */
170
171req.acceptsCharsets = function(...charsets) {
172 const accept = accepts(this);
173 return accept.charsets(...charsets);
· · ·
183 */
184
185req.acceptsLanguages = function(...languages) {
186 return accepts(this).languages(...languages);
187};
+ 27 more matches in this file
lib/application.js JAVASCRIPT 42 matches · showing 5 view file →
57 */
58
59app.init = function init() {
60 var router = null;
61
· · ·
70 configurable: true,
71 enumerable: true,
72 get: function getrouter() {
73 if (router === null) {
74 router = new Router({
· · ·
88 */
89
90app.defaultConfiguration = function defaultConfiguration() {
91 var env = process.env.NODE_ENV || 'development';
92
· · ·
96 this.set('env', env);
97 this.set('query parser', 'simple')
98 this.set('subdomain offset', 2);
99 this.set('trust proxy', false);
100
· · ·
107 debug('booting in %s mode', env);
108
109 this.on('mount', function onmount(parent) {
110 // inherit trust proxy
111 if (this.settings[trustProxyDefaultSymbol] === true
+ 37 more matches in this file
examples/error-pages/index.js JAVASCRIPT 11 matches · showing 5 view file →
28// Routes
29
30app.get('/', function(req, res){
31 res.render('index.ejs');
32});
· · ·
33
34app.get('/404', function(req, res, next){
35 // trigger a 404 since no other middleware
36 // will match /404 after this one, and we're not
· · ·
39});
40
41app.get('/403', function(req, res, next){
42 // trigger a 403 error
43 var err = new Error('not allowed!');
· · ·
46});
47
48app.get('/500', function(req, res, next){
49 // trigger a generic (500) error
50 next(new Error('keyboard cat!'));
· · ·
61// $ curl http://localhost:3000/notfound -H "Accept: text/plain"
62
63app.use(function(req, res, next){
64 res.status(404);
65
+ 6 more matches in this file
examples/vhost/index.js JAVASCRIPT 9 matches · showing 5 view file →
17*/
18
19// Main server app
20
21var main = express();
· · ·
21var main = express();
22
23if (!module.parent) main.use(logger('dev'));
· · ·
23if (!module.parent) main.use(logger('dev'));
24
25main.get('/', function(req, res){
· · ·
25main.get('/', function(req, res){
26 res.send('Hello from main app!');
27});
· · ·
26 res.send('Hello from main app!');
27});
28
+ 4 more matches in this file
test/res.location.js JAVASCRIPT 51 matches · showing 5 view file →
6 , url = require('node:url');
7
8describe('res', function(){
9 describe('.location(url)', function(){
10 it('should set the header', function(done){
· · ·
9 describe('.location(url)', function(){
10 it('should set the header', function(done){
11 var app = express();
· · ·
10 it('should set the header', function(done){
11 var app = express();
12
· · ·
13 app.use(function(req, res){
14 res.location('http://google.com/').end();
15 });
· · ·
21 })
22
23 it('should preserve trailing slashes when not present', function(done){
24 var app = express();
25
+ 46 more matches in this file
History.md MARKDOWN 26 matches · showing 5 view file →
338 - Fix `expires` option to reject invalid dates
339 * deps: depd@2.0.0
340 - Replace internal `eval` usage with `Function` constructor
341 - Use instance methods on `process` to check for listeners
342 * deps: finalhandler@1.2.0
· · ·
533 * Add `options` argument to `res.download`
534 * Improve error message when autoloading invalid view engine
535 * Improve error messages when non-function provided as middleware
536 * Skip `Buffer` encoding when not generating ETag for small response
537 * Use `safe-buffer` for improved Buffer API
· · ·
769 - Add `sameSite` option
770 - Fix cookie `Max-Age` to never be a floating point number
771 - Improve error message when `encode` is not a function
772 - Improve error message when `expires` is not a `Date`
773 - Throw better error for invalid argument to parse
· · ·
790 - deps: ipaddr.js@1.1.1
791 * deps: qs@6.2.0
792 - Add `decoder` option in `parse` function
793 * deps: range-parser@~1.2.0
794 - Add `combine` option to combine overlapping ranges
· · ·
795 - Fix incorrectly returning -1 when there is at least one valid range
796 - perf: remove internal function
797 * deps: send@0.14.1
798 - Add `acceptRanges` option
+ 21 more matches in this file
test/req.subdomains.js JAVASCRIPT 48 matches · showing 5 view file →
4 , request = require('supertest');
5
6describe('req', function(){
7 describe('.subdomains', function(){
8 describe('when present', function(){
· · ·
7 describe('.subdomains', function(){
8 describe('when present', function(){
9 it('should return an array', function(done){
· · ·
8 describe('when present', function(){
9 it('should return an array', function(done){
10 var app = express();
· · ·
9 it('should return an array', function(done){
10 var app = express();
11
· · ·
12 app.use(function(req, res){
13 res.send(req.subdomains);
14 });
+ 43 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.