- Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
enhancementNew feature or requestNew feature or requestimplementedImplemented in master but the issue is still relevantImplemented in master but the issue is still relevant
Description
Would be handy to expose an API so test runners can start & stop the server, optionally with the build system.
Usage
import { parseNetlifyConfig, parseWebpackConfig, Server, Webpack } from "netlify-local"; const netlifyConfig = parseNetlifyConfig("netlify.toml"); const port = 3000; const server = new Server({ netlifyConfig: netlifyConfig, routes: { static: true, lambda: true, }, certificates: { key: <private key as a string>, cert: <certificate as a string>, }, port: 9000, }); await server.listen(); await server.close(); const webpackConfig = parseWebpackConfig("webpack.config.js"); const webpack = new Webpack(webpackConfig); await webpack.build(); webpack.watch();
Methods
Config
-
parseNetlifyConfig()
-
parseWebpackConfig()
Server
-
constructor
-
Server.listen()
-
Server.close()
Webpack
-
constructor
-
Webpack.build()
-
Webpack.watch()
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestimplementedImplemented in master but the issue is still relevantImplemented in master but the issue is still relevant