@1fe/server
v0.1.6
Published
Server-side runtime and utilities for 1FE applications
Downloads
55
Readme
@1fe/server
Express server that serves as the backbone of a 1fe instance, handling dynamic configuration, widget loading, and platform services.
Follow our documentation here to get started with your own 1fe instance.
Installation
npm install @1fe/server
# or
yarn add @1fe/serverWhat is @1fe/server?
The @1fe/server package provides a complete Express.js server implementation for hosting 1fe applications. It includes:
- Dynamic configuration management with live updates
- Widget loading and version coordination
- CSP (Content Security Policy) management
- Health monitoring
Quick Start
Basic Server Setup
import oneFEServer from '@1fe/server';
const app = oneFEServer({
port: 3000,
configManagement: {
widgetVersions: {
url: 'https://your-cdn.com/configs/widget-versions.json',
},
libraryVersions: {
url: 'https://your-cdn.com/configs/lib-versions.json',
},
dynamicConfigs: {
url: 'https://your-cdn.com/configs/live.json',
},
refreshMs: 30000,
},
cspConfigs: {
'script-src': ["'self'", 'https://your-cdn.com'],
'style-src': ["'self'", "'unsafe-inline'"],
},
});
app.listen(3000, () => {
console.log('1fe server running on port 3000');
});To learn more, follow the reference guide here
Related Packages
- @1fe/shell - Application shell and platform utilities
- @1fe/cli - CLI tools for widget development
Community
If you have questions or want to discuss this project, please visit the Issues or Discussions pages in our monorepo.
License
MIT © Docusign Inc.
