Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Demo to show how offline app can work with Jsstore

NotificationsYou must be signed in to change notification settings

udaychy/ChatRoomDemo

Repository files navigation

This is a demo to show how offline app can be made simply withJsStore.

Overview

In Chat Room Demo, The messages sent or received are stored locally in indexedDB usingJsStore and synced with the server in each request.

If the user is offline or server is not responding, the messages are stored locally and these failed messages are pushed to server andnew messages are fetched from the server whenever user goes online or server starts responding.

Two new things are introduced in this demo which you should know:

  • JsStore:It is an IndexedDB Wrapper. It makes IndexedDB super easy with its SQL like apis.

  • Json-server:It provides API for CRUD operation on any json file(say db.json) which contains the data(like a Database) It run on node.js.

Installation

1. Install node.js

If node.js is not installed in your system then you can get it fromhere.

2. Clone/download the ChatRoomDemo

3. Install Package

Open the Node.js command prompt and go to the directory(ChatRoomDemo) which containspackage.json filethen enter the command below

$ npm install

This command will install the required modules for this demo.

4. Start the json-server and http-server

Open the Node.js command prompt and go to the directory(ChatRoomDemo) which contains thedb.json file. Once you are pointing to the ChatRoomDemo directory in Node.js command prompt, enter the command below

$ npm start

Ready to go

The site will be hosted athttp://localhost:8080.Now you can start playing with this demo by going offline and online from theNetwork tab of Browser Developer toolalt Browser Developer tool screenshot

About

Demo to show how offline app can work with Jsstore

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp