Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:04:20+00:00 2026-06-06T03:04:20+00:00

I have a Node.js web server running on an embedded Linux system. For authentication

  • 0

I have a Node.js web server running on an embedded Linux system. For authentication I’m currently using Passport’s Local Strategy, and the user account information is stored in the Node script itself as follows.

var users = [
    { id: 1, username: 'bob', password: 'secret', email: 'bob@example.com' }
  , { id: 2, username: 'joe', password: 'birthday', email: 'joe@example.com' }
];

It works, but I’d like to store the usernames and passwords in a separate file and be able to add, delete and change users through the web browser interface. I don’t want to use a database server to store the user accounts because I feel it’s too much overhead for my embedded system.

Does anyone know of a good way to store the user accounts in a separate file with possibly a library to help update the accounts?

EDIT: The Node server is running on electronics hardware which will have very few (2-20 maybe) users, so there shouldn’t be a problem with people stepping on each other doing user list updates. After initial set-up, the user list won’t change much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:04:23+00:00Added an answer on June 6, 2026 at 3:04 am

    A very simple approach would be to just read from a JSON file. On updates then write to accounts.json.(process id).tmp and rename the file to accounts.json. There’s a small risk you’ll lose an update if two come in at the same time, but maybe you can live with that. (If you can’t then use a “real” database for some value of “real”).

    You can use JSON.stringify(data) to convert a data structure to JSON and JSON.parse(json) to convert the JSON string from the file to a data structure.

    If your service/server has little enough use that you can block you can read the accounts with

    var data = JSON.parse(fs.readFileSync( file_name ) );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my problem: I have server A, running node.js and using socket.io for communicating
I understand the Drupal Services Module, and have node creation, and user authentication working.
Currently i have a node.js and socket.io application in development on my local machine
I have an apache web server running on my ubuntu server box. Recently, I
I have a few SSRS reports running on SQL Server 2008 Web Edition SP1
I currently have a CodeIgniter web app running on Ubuntu with nginx. I just
I'm using one server to host multiple Node.js web apps, which are distributed across
I'm designing a system where I have 2 nodes: 1 node with a web
I have a web page that establishes communication with a node.js server. I am
I have a web server written in Node.js and I would like to launch

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.