Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
JSON:API
node v8.17.0
version:
1.0.0
endpoint
share
tweet
This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out:
const fortune = require("fortune"); const mongodbAdapter = require("fortune-mongodb"); const store = fortune({ a: { b: [Array("b"), "a"], }, b: { a: ["a", "b"] } }, { adapter: [ mongodbAdapter, { url: `mongodb://test:
[email protected]
:49806/devour-demo` } ] });
const fortuneHTTP = require("fortune-http"); const jsonApiSerializer = require("fortune-json-api"); const jsonApiListener = fortuneHTTP(store, { serializers: [[jsonApiSerializer]] });
const Express = require("express"); const cors = require("cors"); const app = Express();
app.use(cors()); app.use(jsonApiListener);
module.exports.endpoint = app;
Loading…
no comments
sign in
to comment