193 matches across 6 files for func main lang:JavaScript lang:JavaScript lang:JavaScript lang:JavaScript
snippet_mode: auto · sorted by relevance
62
63req.get =
64▶req.header = function header(name) {
65 if (!name) {
66 throw new TypeError('name argument is required to req.get');
· · ·
125 */
126
127▶req.accepts = function(){
128 var accept = accepts(this);
129 return accept.types.apply(accept, arguments);
· · ·
138 */
139
140▶req.acceptsEncodings = function(){
141 var accept = accepts(this);
142 return accept.encodings.apply(accept, arguments);
· · ·
169 */
170
171▶req.acceptsCharsets = function(...charsets) {
172 const accept = accepts(this);
173 return accept.charsets(...charsets);
· · ·
183 */
184
185▶req.acceptsLanguages = function(...languages) {
186 return accepts(this).languages(...languages);
187};
+ 27 more matches in this file
57 */
58
59▶app.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
90▶app.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
28// Routes
29
30▶app.get('/', function(req, res){
31 res.render('index.ejs');
32});
· · ·
33
34▶app.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
41▶app.get('/403', function(req, res, next){
42 // trigger a 403 error
43 var err = new Error('not allowed!');
· · ·
46});
47
48▶app.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
63▶app.use(function(req, res, next){
64 res.status(404);
65
+ 6 more matches in this file
17*/
18
19▶// Main server app
20
21var main = express();
· · ·
21▶var main = express();
22
23if (!module.parent) main.use(logger('dev'));
· · ·
23▶if (!module.parent) main.use(logger('dev'));
24
25main.get('/', function(req, res){
· · ·
25▶main.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
6 , url = require('node:url');
7
8▶describe('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
4 , request = require('supertest');
5
6▶describe('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 login | both terms (AND is implicit) |
auth OR login | either term |
NOT path:vendor | exclude matches |
"exact phrase" | quoted exact match |
/func\s+Test/ | regex |
handler~1 | fuzzy (Levenshtein 1) |
file:*_test.go | filename glob |
path:pkg/auth/** | full path glob |
lang:go | language 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.