rsnext/examples/custom-server-reasonml
2019-07-08 19:37:58 -04:00
..
pages Custom ReasonML Server (#6970) 2019-04-09 15:15:41 -04:00
server Custom ReasonML Server (#6970) 2019-04-09 15:15:41 -04:00
.gitignore Custom ReasonML Server (#6970) 2019-04-09 15:15:41 -04:00
bsconfig.json Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
package.json Update remaining examples to latest Next.js 2019-07-08 19:37:58 -04:00
README.md Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00

Custom server REASONML

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Build the app

yarn next:build
npm run next:build

Run the production app

Run this command after yarn build.

yarn start

The idea behind this example

ReasonML is an exciting new language and since it can compile directly to JS via bucklescript that means that we can power our backend server with REASONML and also have the frontend built with reasonreact, which is covered in another example. This example shows how powerful & helpful it can be to build a next js custom server with a typesafe language.

The example has been built off the custom-server example that uses pure nodejs to build the custom server.