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

Adding path to repo #92

Open
adhvaithprasad opened this issue Jan 15, 2022 · 0 comments
Open

Adding path to repo #92

adhvaithprasad opened this issue Jan 15, 2022 · 0 comments

Comments

@adhvaithprasad
Copy link

You can use it with express like following :

const path = require('path');
const express = require('express');
const app = express();
const Server = require('node-git-server');

const repos = new Server(path.resolve(__dirname, 'tmp'), {
    autoCreate: true
});
const port = process.env.PORT || 7005;

app.use('/git', function(req, res) {
  repos.handle(req, res)
});

app.listen(7005, () => {
  console.log(`Express http server listening`);
});

Is this what you want ?

Originally posted by @esp10mm in #58 (comment)

I am getting errors like :
const u = url_1.default.parse(req?.url || '');
^

SyntaxError: Unexpected token '.'

@adhvaithprasad adhvaithprasad changed the title You can use it with express like following : Adding path to repo Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant