I have developed a web application in node.js express framework. I have different systems that are used for various purposes.
When I call REST endpoints it should communicate with those systems and collect data. I want to know how can make my web application communicate to this system over a text file.
Not sure why do you need to use a text file, but if I understand correctly, what you need is basically something like Redis or Kafka. It would allow you to create kind of a "central" process where you can save/read information.
https://redis.io/
https://kafka.apache.org/
There're more options out there, just start with these ones and try to figure out if it's exactly what you need.
Related
Is there a way to compile a node.js application for multiple devices? I would like to use Electron for desktop (Chromium), NativeScript for mobile devices and also have a SPA for common browsers. There are many parts of this application that look alike - although those systems are not combatible between each others, there must be a way to share the key parts between each other.
Unfortunately there is not much information on the web about this issue, thanks in advance.
I've voted to close because the question is too broad, but here is some general information to help you develop more specific questions:
There are any number of ways to do what you're asking for. But generally you'll want an API capable of servicing all of your clients (the term API is being used very generally. It may not be a simple REST API you're looking for, depending on what you are trying to do). As for deploying your application to multiple platforms, you'll either need to find a library, framework, language, and/or emulator which supports UIs for all of your desired platforms, or create dedicated clients for each device, or a mix of the two. For simple HTML applications, React is one such front-end library/methodology/framework which can support multiple platforms through its various versions. You could use something such as Electron to pack up your application and make it look like a native app.
I am a very beginner in NodeJS so my question can appear very simple but I've downloaded 2 kinds of programs (basically a first program that generate data and something that displays in another way the information) and I want to "connect them".
The first works using client/server JS/Node.js and the display program works using client/server JS/Node.js but I launch them separately. But I want informations extracted from the first program are sent to the other program.
It is surely possible but I don't know how to pass information from a program to another simultaneously when Node is used ?
Can you give me a piece of advice of what concept I should study to do it.
Thanks
Web apps consist of a client (code send to the user's browser) and an API which is how the client communicates with the server.
The code you downloaded probably uses a REST API. Most node projects are built using an existing web server framework line Express, which will hold the API information in some top level file under the server directory. To get the two servers to communicate, you can make requests (a standard library to use would be axios) from one server to the other server.
So basically, I'm looking to build a web app that aggregates a bunch of data from various web services and presents the data visually. To achieve what I want, I will basically need to regularly poll these web services, and store the resulting data from each call in a database. This data would then be queried by the web app etc.
I'm looking to build the web app using PHP (code igniter), but I'm not entirely sure how to go about the polling component. I'm coming from a .NET background and still getting used to the Linux/web world. I would normally solve this problem by simply writing a .NET Windows Service... I want all of this to run on a linux box however, so if anyone could recommend any technologies for this sort of thing that would be great.
Thanks in advance!
I have a client-server relationship between two apps: a web application and an OCX. What I want to do is communicate the client part of the web application, running on the local PC, with the OCX, also installed in the same PC. The server app (the OCX) is not mine (I can't change its source code) and offers 2 ways of communicating with client apps: through an intermediate file or through a socket. There are lot of restrictions in the PCs where the apps have to be executed (the users, for example, are not administrators of their own PCs) so it's even more difficult than it seems. My doubt is which technology would be better to handle this communication from the cliente app (JavaScript, Java Applets, another OCX, etc.) and which option could be handled easier (file or sockets) by this technologies. And also which would be the security and permissions settings that should be taken into account to make it all work properly. You must know that, in case of using an intermediate file, I must be able to write in specific positions of that file from the web app (I'm not sure if Javascript's FileSystemObject can do this, for example). Thanks in advance.
Working with Sockets is realy easy. I only don't know the security options of sockets. May be you can take a look here: Oracle Sockets
I am currently devising 3 database desktop applications for different users in a manufacturing company (one for the accounting department, sales department, production department). All applications have different functions but they should be able to access the data of the other department to reflect business transactions. What is the best programming language and database to use for this kind project? The three computers are not physically connected so I was thinking of having them to access a remote database. The language I am most familiar with is Java but I am very open to learning others if it would be more beneficial to the company. I was also thinking of having to use Adobe Air as I am adept with web programming but could still run as a desktop app but I can't seem to find sufficient resources of distributed systems using Adobe air. Any ideas would be very much appreciated. Thanks!
Lots of languages will do this just fine, including Java. You're familiar with that so my advice is stick to it with one caveat: depending on your requirements I would seriously suggest examining the possibility of making it a Web app instead. Desktop database apps are somewhat... old-fashioned. More to the point they'll create a bunch of headaches for you such as installation, Swing is annoying and tedious, etc.
As for what database, barring requirements you haven't specified, anything will do so pick something free like MySQL.
So for a desktop Java app I would:
Put the database on a remote server;
Put an application server or Web container on that same server;
Create a Webapp on the app server for handling RPC;
Pick a method of RPC, be it Web services or whatever, and use Spring to implement it;
Create a desktop Java app in Swing and distribute it to clients from the app server via Webstart (JNLP).
If it's a Web app:
Put the database and appserver or Web container on one server;
Pick a Java Web framework and create a bunch of Web pages that do what you want.
In all cases, have it be the same app but just act differently on the user type. This is much better than maintaining three different apps.
Also if you do a Web app, you might want to consider using PHP as it's a fast and proven way of knocking up Web pages and probably sufficient for the kind of internal application that you're doing.