Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc]:How to add custom route on express level - upward proxy #2552

Closed
mercs600 opened this issue Jul 14, 2020 · 3 comments
Closed

[doc]:How to add custom route on express level - upward proxy #2552

mercs600 opened this issue Jul 14, 2020 · 3 comments
Labels
documentation This pertains to documentation. Progress: dev in progress

Comments

@mercs600
Copy link
Contributor

Describe the request
Hi, I would like to create custom endpoint on express server for robots.txt file - solution from venia it doesn't fit for us, because this is one static file and I need multiple configuration of robots per environment.
Generally I have stuck. There is no problem to express config, but what should I setup in upward.yml to allow connect to node server directly ?

My server.js with upward config

 const upwardServerOptions = Object.assign(
        // defaults
        {
            bindLocal: true,
            logUrl: true
        },
        config.section('upwardJs'),
        stagingServerSettings, // overrides upward options
        {
            env: process.env,
            before(app) {
                addImgOptMiddleware(app, {
                    ...config.section('imageOptimizing'),
                    ...config.section('imageService')
                });
                app.use(bestPractices());
                app.get('/robots.txt', function(req, res) {
                    res.sendStatus(200);
                    res.send('Test')
                });
            }
        }
    );
@mercs600 mercs600 added the documentation This pertains to documentation. label Jul 14, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jul 14, 2020

Hi @mercs600. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@jcalcaben
Copy link
Contributor

@mercs600
you may get the answer you need by posting this question in our community slack channel:

https://magentocommeng.slack.com/archives/C71HNKYS2

@TheRealHunzik
Copy link

Hello There @mercs600 & @jcalcaben

do you have found any solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This pertains to documentation. Progress: dev in progress
Projects
None yet
Development

No branches or pull requests

3 participants