NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

Overview

NiseLine

NiseLine

NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

Getting Started

Launch NiseLine server by Docker image.

docker run -d -p 3000:3000 dyoshikawa/niseline:latest

And install NiseLiff SDK.

npm i @niseline/niseliff

Use NiseLiff SDK in your client app!

import { buildNiseliff } from '@niseline/niseliff'
import React from 'react'
import ReactDOM from 'react-dom'

const liff = buildNiseliff({
  liffId: 'DUMMY_LIFF_ID',
})

liff
  .init({
    liffId: 'DUMMY_LIFF_ID',
  })
  .then(() => {
    ReactDOM.render(
      <React.StrictMode>Your client app</React.StrictMode>,
      document.getElementById('root')
    )
  })

NiseLiff SDK

Setup

Install @niseline/niseliff.

npm i @niseline/niseliff

Usage

With npm package of LIFF SDK

You can use with npm package of LIFF SDK. Switch between the real LIFF SDK and the NiseLiff SDK for each environment. In this example, the NiseLiff SDK is used only in the local environment.

// /path/to/config.ts

export const env: 'local' | 'development' | 'staging' | 'production' = 'local'
// /path/to/liff.ts

import * as config from '/path/to/config'
import realLiff, { Liff } from '@line/liff'
import { buildNiseliff } from '@niseline/niseliff'

const liff =
  config.env === 'local' ? buildNiseliff({ liffId: 'DUMMY_LIFF_ID' }) : realLiff
export default liff
// /path/to/index.tsx

import liff from '/path/to/liff'
import React from 'react'
import ReactDOM from 'react-dom'

liff.init({ liffId: 'DUMMY_LIFF_ID' }).then(() => {
  ReactDOM.render(
    <React.StrictMode>Your client app</React.StrictMode>,
    document.getElementById('root')
  )
})

With CDN of LIFF SDK

You can also use with CDN of LIFF SDK. If you use typescript, it is recommended that you install the @line/liff package. The actual runtime is a CDN, but the type definitions are available from the npm package.

// /path/to/config.ts

export const env: 'local' | 'development' | 'staging' | 'production' = 'local'
// /path/to/index.tsx

import * as config from '/path/to/config'
import { Liff } from '@line/liff'
import { buildNiseliff } from '@niseline/niseliff'
import React from 'react'
import ReactDOM from 'react-dom'

declare global {
  var liff: Liff
}

if (config.env === 'local') {
  window.liff = buildNiseliff({
    liffId: 'DUMMY_LIFF_ID',
  })
}

window.liff
  .init({
    liffId: 'DUMMY_LIFF_ID',
  })
  .then(() => {
    ReactDOM.render(
      <React.StrictMode>Your client app</React.StrictMode>,
      document.getElementById('root')
    )
  })

Features

NiseLine Server

Setup

Pull and run dyoshikawa/niseline.

Docker

docker run -d -p 3000:3000 dyoshikawa/niseline:latest
curl http://localhost:3000/niseline/api/ping
# => {"ping":"pong"}

Docker Compose

# docker-compose.yml
version: '3'
services:
  niseline:
    image: dyoshikawa/niseline:latest
    ports:
      - 3000:3000
docker compose up -d
curl http://localhost:3000/niseline/api/ping
# => {"ping":"pong"}

Usage

curl --request POST \
  --url http://localhost:3000/niseline/api/users \
  --header 'content-type: application/json' \
  --data '{"id": "FOO_ID","name": "Foo","picture": "http://example.com/foo.jpg","email": "[email protected]"}'
# => null

curl -v -X POST 'http://localhost:3000/oauth2/v2.1/verify' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'id_token=FOO_ID' \
  --data-urlencode 'client_id=1234567890'
# => {"iss":"https://example.com","sub":"FOO_ID","aud":"1234567890","exp":1504169092,"iat":1504263657,"nonce":"0987654asdf","amr":["pwd"],"name":"Foo","picture":"http://example.com/foo.jpg","email":"[email protected]"}

Features

Login API

Messaging API

You might also like...

The Remix Stack for deploying to Vercel with testing, linting, formatting, structure and mock for 3rd party API integration.

The Remix Stack for deploying to Vercel with testing, linting, formatting, structure and mock for 3rd party API integration.

Remix DnB Stack See it live: https://dnb-stack.vercel.app/ Learn more about Remix Stacks. npx create-remix --template robipop22/dnb-stack What's in th

Dec 13, 2022

LIFF Mock is a LIFF Plugin that make testing your LIFF app easy.

LIFF Mock LIFF Mock is a LIFF Plugin that make testing your LIFF app easy. ※ LIFF Plugin feature is available since LIFF SDK v2.19.0. Usage NPM $ npm

Dec 2, 2022

mock APIs, intelligently, with context, and perform other stuff as well

@sasta-sa/project mock APIs, intelligently, with context, and perform other stuff as well 😄 Setting up Clone the project git clone https://github.com

Jan 27, 2022

A mock Twitter page implemented without, partially with, and then with a design system.

Design Systems Workshop A mock Twitter page implemented without, partially with, and then with a design system. Setup Install npm dependencies, then s

Dec 8, 2022

Test utility to mock `window.matchMedia` for JSDOM environments.

mock-match-media Test utility for mocking window.matchMedia in JSDOM environments. JSDOM doesn't provide support for window.matchMedia, which means te

Oct 12, 2022

RESTful service to provide API linting as-a-service

API Linting Service Prerequisites / general idea General idea behind this API implementation is to provide an API as a service based on the awesome sp

Mar 14, 2022

TypeScript plugin for service-to-service (aka. "functionless") cloud integrations.

Functionless λ Functionless is a TypeScript plugin that transforms TypeScript code into Service-to-Service (aka. "functionless") integrations, such a

Jan 2, 2023

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Jan 5, 2022

Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable, and testable code is the projects goal.

ESP-TypeScript Transpile TypeScript to Espruino flavor of JavaScript for ESP8266/ESP32 microcontrollers template project. Writing safe, maintainable,

Dec 20, 2022
Releases(v0.9.0)
  • v0.9.0(Jan 20, 2022)

    What's Changed

    • v0.9.0 by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/10

    Full Changelog: https://github.com/classmethod/niseline/compare/v0.8.0...v0.9.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jan 20, 2022)

    What's Changed

    • add description to package.json by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/6
    • fix readme and sample-client-app by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/7
    • Add methods to @niseline/niseliff by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/8
    • v0.8.0 by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/9

    Full Changelog: https://github.com/classmethod/niseline/compare/v0.7.0...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jan 20, 2022)

    What's Changed

    • fix publish.yml by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/2
    • publish by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/3
    • readme by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/4
    • v.0.7.0 by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/5

    Full Changelog: https://github.com/classmethod/niseline/compare/v0.6.0...v0.7.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Jan 20, 2022)

    What's Changed

    • v0.6.0 by @cm-dyoshikawa in https://github.com/classmethod/niseline/pull/1

    New Contributors

    • @cm-dyoshikawa made their first contribution in https://github.com/classmethod/niseline/pull/1

    Full Changelog: https://github.com/classmethod/niseline/commits/v0.6.0

    Source code(tar.gz)
    Source code(zip)
Owner
クラスメソッド株式会社
クラスメソッド株式会社
Linely is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

Linely Linely is inspired by LocalStack. Goal of this tool is to create a mock service for LINE. Setup Docker docker run -d -p 3000:3000 dyoshikawa/li

null 4 Jan 24, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Quickly create an interactive HTML mock-up by auto sourcing lorem ipsum/images generators, with minimal html markup, and no server side code

RoughDraft.js v0.1.5 Quickly mockup / prototype HTML pages with auto-generated content, without additional JavaScript or server side code. <section>

Nick Dreckshage 464 Dec 21, 2022
The LMS (Life Management System) is a free tool for personal knowledge management and goal management based on Obsidian.md.

README Documentation | 中文帮助 The LMS (Life Management System) is a tool for personal knowledge management and goal management based on Obsidian.md. It

null 27 Dec 21, 2022
An Awesome Toggle Menu created with HTML,CSS,JQuery,font-awesome and line by line comment.

Demo : https://blackx-732.github.io/AwesomeMenu/ Under open source license No ©copyright issues Anyone can be modify this code as well Specifically we

BlackX-Lolipop 2 Feb 9, 2021
Base-mock-api - Repo to storage my fake api's to use in my 2022 projects.

Base Mock API's Project made 100% with JavaScript, with the objective of creating endpoints to use in projects. Prerequisites Before you begin, ensure

Arthur Cabral 0 Nov 20, 2022
A social-media mock app for the ones who love to read - and maybe show it off

?? ?? Cachalote ?? ?? Share what you are reading and find people who also likes it - or not! What does it do? This app focuses on three main questions

Thaís França 3 May 22, 2022