Пример #1
0
		/// <summary>
		/// Creates a new instance of the BabelFileMiddleware.
		/// </summary>
		/// <param name="next">The next middleware in the pipeline.</param>
		/// <param name="options">The configuration options.</param>
		public BabelFileMiddleware(Func<IDictionary<string, object>, Task> next, BabelFileOptions options)
		{
			if (next == null)
				throw new ArgumentNullException("next");

			_next = next;

			// Default values
			_options = options ?? new BabelFileOptions();
		}
Пример #2
0
		/// <summary>
		/// Enables serving JavaScript files compiled via Babel.
		/// </summary>
		public static IAppBuilder UseBabel(this IAppBuilder builder, BabelFileOptions options = null)
		{
            return builder.Use<BabelFileMiddleware>(options ?? new BabelFileOptions());
        }