Run script on server startup - reactjs

Is it possible to run a script in javascript at server startup? I did an internet search and this seems to be impossible with next.js
console.log('Server is running!')

Related

Connect Reactjs to ASP.net Core 6 Web API on the same server

REACT_APP_API_URL is localhost:4260 on my dev machine
when i run dotnet run api.dll it defaults to 5000, so I build of react with 5000 and run both processes on the server, it doesn't connect.
It does work, however if on the client machine I have visual studio running on debug mode and it's using port 5000.
I've tried tutorials online, follow all the steps but I get no success. Works on local, just not server.

WebDriver - How to launch tests on remote server automatically?

Problem:
To run WebDriver tests using it appears that the UI (desktop) must be active for WebDriver to 'see' the browser and correctly run the tests.
When trying to automatically launch a set of tests on a Windows 2012 server using Scheduled Tasks, the tests fail because when the tests are launched there is no UI/desktop active.
Bad solution:
The only way we can get the WebDriver tests to run properly is to manually log in to each Windows 2012 server that is hosting the tests so that the UI/desktop is active. However, this is not practical if we are running tests on 20 servers at a time. (We would need to have a human log into each server for each test run!)
Question:
How can we:
a) launch a Windows 2012 executable that gets an active UI/desktop (logged in) without a manual login?
b) get WebDriver to not need the UI/desktop to be active to run the test?

Check_mk_agent Error: Failed to gather SQL Server instances

I am using Check_mk monitoring. I would like to monitor my SQL Server performance counters.
I have placed mssql.vbs plugin in the Check_mk agent plugin folder and then restarted the Check_mk_agent service.
Post that, I have performed the discovery in Check_mk server.
By doing everything listed above, I am not able to see any performance counters in Check_mk server.
I have also run the Check_mk_agent.exe on the command prompt, it is showing error:
Failed to gather SQL Server instances
No luck. Any feedback is appreciated.
Resolved.
I have used the check_mk_agent 1.2.8p13 Core.
You can find the agent on below URL:
https://mathias-kettner.de/check_mk_download_source.html
Install the check_mk_agent.msi and put the mssql.vbs plugin in the plugin folder.
Go to your command prompt and try:
C:\Program Files (x86)\check_mk\check_mk_agent.exe test

Automated REST/Jetty Server startup in CMake buildsystem

I have multiple C Unit Test programs that connects to a REST Server and sends/receives some data. I usually open a new terminal and start the server by typing mvn jetty:run and in a different terminal I do perform the Unit Tests by entering make test. The problems is that the Code is tested by a Jenkins server and the Unit Tests fail because they can't connect to a REST Server. I tried opening the REST Server with a CMake execute_process(COMMAND mvn jetty:run), but then the Unit Tests never ends because the server is waiting for input. I also tried opening the server with mvn jetty:start, but the Server doesn't seem to remain active after the command finishes. It just tells "Jetty Server started", but I can't see any running REST Server nor make a connection with it and mvn jetty:stop says there is no active server running. I also tried opening the server in parallel using the &, but Maven blocks it. The attempt to open the Jetty Server in parallel using a ShellScript that I would execute using the & didn't work either. Also the problem is that when I execute the Server in parallel I don't know when the server has started up and is ready for the Unit Tests to begin.
The best solution would be if I could open the server, perform the Unit Tests and close the server afterwards fully automated with CMake.

VS loadtest results are not written to the DB on build agent

I created a load test repository in my local machine SQL DB using loadtestresultsrepository.sql script. Then changed connection string from the default SQL Server Express local db to the one I wanted to store the test results using Manage Test Controllers window. Then I ran the test using VS ,MSTest command line and Powershell locally and results were written to the DB successfully.
I wanted to achieve the same outcome on TFS 2015 build agent so that I could run the load and performance test on the CI server. When I ran the load test on CI server using a build definition that uses command line mstest task /TestContainer:$(build.sourcesDirectory)\$(Component)\LoadTests\20_Users.loadtest, it did not write any data to default (localdb)\v11.0 server. But the load test ran successfully. I RDP to the build agent, open the solution from previously copied build artifacts and again set the connection string to the SQL server DB on the build agent using Manage Test Controllers window. Also created load test repository on build agent as well. But load test results are not written to the DB when I am running the tests using build definition.If I execute the same mstest command using powershell or cmd prompt on build agent, it writes the results. Can someone help me. How can I get the build definition / test controller to write the data to the DB I have configured in build agent ?

Resources