decentralized-internet
Version:
An NPM library of programs to create decentralized web and distributed computing projects
29 lines (24 loc) • 605 B
JavaScript
const fs = require('fs');
const path = require('path');
exports.plugin = {};
exports.plugin.register = async function (server, options) {
server.path(__dirname);
server.route({
path: '/',
method: '*',
handler: function (request, reply) {
return reply.redirect('/public');
}
});
server.route({
path: '/public/{path*}',
method: 'GET',
config: {
handler: {
directory: { path: './clusterpost-public/build', listing: false, index: true }
},
description: 'This route serves the static website of clusterpost.'
}
});
};
exports.plugin.pkg = require('./package.json');