Skip to content

Static Assets

Danny SMc edited this page May 13, 2021 · 6 revisions

Static Assets

The standard support for serving static assets is still available and the framework object has a proxy function for that, see below.

import { Framework } from 'rewyre';

(async () => {

	const application: Framework = new Framework({
		port: 8080,
	});

	// First param is the folder path and the last param is the URL prefix, this is
	// optional and can be left out to use the base path.
	application.useStatic('../public', '/public');

	await application.start();
})();

Useful Links:

Clone this wiki locally