Open Slydelix opened 5 years ago
What would your custom endpoints do?
List all repos, show info about repos, literally anything
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 ?
This is what groffee was supposed to be, https://github.com/gabrielcsapo/groffee. This library was meant as a backing library to build a GitHub like application.
On Mon, Aug 19, 2019 at 2:34 AM esp10mm notifications@github.com wrote:
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 ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gabrielcsapo/node-git-server/issues/58?email_source=notifications&email_token=AAOE2W4Y2KMFYRP67MTFJRTQFJSLDA5CNFSM4IIFCT32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4SJPQI#issuecomment-522491841, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOE2WYVCSDN7G3N2BVA5QLQFJSLDANCNFSM4IIFCT3Q .
@esp10mm yes but i want to able to do that with the http server the git server is already running on... EDIT: Actually no, I want to be able to add my own functions and stuff to the existing server, not redirect stuff to it
@gabrielcsapo since that lib isn't going switching to express may work... We could to server.express.get("/customroute", (req, res) => {});
Is it possible to create our own endpoints? If yes, how and if not, could you implement something like this?