Soya Next
  • Introduction
  • Packages
    • soya-next
    • soya-next-cli
    • soya-next-scripts
    • soya-next-server
  • Getting Started
    • Setup
    • Directory Structure
    • Creating an App
    • Build the App for Production
  • User Guide
    • Analyzing Dependencies
    • Configure Redux Store
    • Custom Babel Configuration
    • Custom Document
    • Custom Marlint Configuration
    • Custom Routing
    • Typescript Configuration
    • Universal Environment Configuration
  • Migration Guide
    • 0.4.x to 0.5.x
  • API Reference
    • applyReducers([reducers])
    • createPage([...connectArgs])(Page, [reducers])
    • createRouter(app, [options])
    • withLocale
    • LocaleLink
  • Examples
    • Apollo
    • Authentication
    • CSS Modules
    • CSS Modules with SCSS
    • Custom Routes
    • Internationalization
    • Internationalization with Redux
    • Redirection
    • TodoMVC
  • License
Powered by GitBook
On this page
  • Usage
  • How It Works
  1. Examples

Custom Routes

PreviousCSS Modules with SCSSNextInternationalization

Last updated 7 years ago

Usage

Clone this repository:

git clone https://github.com/traveloka/soya-next.git
cd soya-next/examples/custom-routes

Then, install and run it:

npm install
npm start

Open in your browser.

How It Works

This example uses to enable custom routing.

To use it, create a configuration file at config/default.json with the following:

{
  "routes": {
    "/path/:param1/:param2": {
      "page": "/path/to/custom-page"
    }
  }
}
http://localhost:3000
express router