-1

I need to get the list of all the repositories and all the branches from TFS.

I have a react app and I wonder if there is some way to use TFS API from it. Or maybe I should load C# DLL's in order to do that?

Thanks :)

I found this: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list?view=azure-devops-rest-6.0&tabs=HTTP but it is for C#.

2 Answers2

0

From my knowledge, React uses Javascript. Here is the client library for different languages, include Node.js.

And here you could see the usable rest api for Node.js.

You could get Branches for Git repo and TFVC repo: enter image description here

Please see details here: Git repo api & TFVC repo api.

Antonia Wu-MSFT
  • 499
  • 2
  • 4
  • Thanks! Actually, it's in angular and I'm looking on something in js. – Sapir Hender Nov 10 '22 at 12:38
  • Hi, generally js. and node.js could use the same api. But considering js. in angular may be different, If you do want to use api for angular js. language, you can directly report the feature requests: https://developercommunity.visualstudio.com/report?space=22&entry=suggestion. Or try to write some scripts to convert the existing nodejs api to your js. for using? I am not very familiar with the js. language, so it's just a suppose. Thanks. – Antonia Wu-MSFT Nov 16 '22 at 07:58
  • Thanks! I decided to do an MVC ASP .NET app with controller and the react app inside the client because I already have code in C# that connect to the TFS and do some queries. If it will help someone: -[Use React with ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/client-side/spa/react?view=aspnetcore-7.0&tabs=visual-studio) - [How To Develop and Build React App With .NET Core Backend](https://medium.com/bb-tutorials-and-thoughts/how-to-develop-and-build-react-app-with-net-core-backend-59d4fc5e3041) – Sapir Hender Nov 17 '22 at 09:54
0

I decided to do an MVC ASP .NET app with controller and the react app inside the client because I already have code in C# that connect to the TFS and do some queries (TFS has a REST api for C# also). If it will help someone:
Use React with ASP.NET Core
How To Develop and Build React App With .NET Core Backend