Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
Electron JS - Where can I safely implement Restful API in my application?

My client asked me to create an application using Electron both for the frontend and backend. I need to implement some API to get or post datas, but i can't seem to find out where is the safest way to implement them. I implemented them in the preload.js file, like this (using express js and postgresql and sequelize):

app.get('/users', async(req, res) => {
   try {
      const users = await User.findAll();
      return res.json(users);
   }catch (e) {
      console.log(e);
      return res.status(500).json({err: 'something went wrong'})
   }
});

But I've been reading that some malicious users could access the API in the preload file and run code on the user machine, I wanted to ask you where should I implement these APIs if there's a standard architecture for projects like this. Thank you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!