|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
732 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Copyright (c) 2015-present, Facebook, Inc.
|
|---|
| 3 | *
|
|---|
| 4 | * This source code is licensed under the MIT license found in the
|
|---|
| 5 | * LICENSE file in the root directory of this source tree.
|
|---|
| 6 | */
|
|---|
| 7 | 'use strict';
|
|---|
| 8 |
|
|---|
| 9 | const launchEditor = require('./launchEditor');
|
|---|
| 10 | const launchEditorEndpoint = require('./launchEditorEndpoint');
|
|---|
| 11 |
|
|---|
| 12 | module.exports = function createLaunchEditorMiddleware() {
|
|---|
| 13 | return function launchEditorMiddleware(req, res, next) {
|
|---|
| 14 | if (req.url.startsWith(launchEditorEndpoint)) {
|
|---|
| 15 | const lineNumber = parseInt(req.query.lineNumber, 10) || 1;
|
|---|
| 16 | const colNumber = parseInt(req.query.colNumber, 10) || 1;
|
|---|
| 17 | launchEditor(req.query.fileName, lineNumber, colNumber);
|
|---|
| 18 | res.end();
|
|---|
| 19 | } else {
|
|---|
| 20 | next();
|
|---|
| 21 | }
|
|---|
| 22 | };
|
|---|
| 23 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.