gabrielcsapo / gabrielcsapo/node-git-server

Adding path to repo

Open
#92 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
262
Forks
81
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/gabrielcsapo/node-git-server/issues/58#issuecomment-522491841_

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

SyntaxError: Unexpected token '.'

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Express usage example in the issue and the reported `url_1.default.parse(req?.url || '')` error. Trace the relevant entry point and verify the supported Node.js runtime; done means the documented Express setup runs without the reported syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, nodejs, typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.