namespace WebApiServer.Migrations
{
using Microsoft.EntityFrameworkCore.Migrations;
public partial class AddAvatarColumnToUsersTable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
"Avatar",
"Users",
"varchar(255)",
nullable: false, defaultValue: "0");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
"Avatar",
"Users");
}
}
}
import browserify from 'browserify';
const config = {
path: {
build: 'dist/',
clean: ['dist/content.js'],
content: 'content.js',
src: 'src/index.js',
}
};
const clean = () => del(config.path.clean);
export { clean };
export function js() {
return browserify({entries: config.path.src, debug: false})
.transform(babelify, { presets: ['es2015'] })
.bundle()
.pipe(source(config.path.content))
.pipe(buffer())
.pipe(uglify({mangle: false, ecma: 6}))
.pipe(size({ title: 'JS' }))
.pipe(gulp.dest(config.path.build));
}
const build = gulp.series(clean, js);
export { build };
export default build;
//@ts-ignore
import fontawesome from '@fortawesome/ fontawesome';
//@ts-ignore
import regular from '@fortawesome/ fontawesome-free-regular ';
[Route("api/[controller]/{code}")] // заменить на [Route("{code}")]
[HttpGet]
// для доступа к сущностям по их id
// /news/view/{id}
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
// для доступа к пользователям по их nickname
// /news/view/{id}
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{nickname}");
public void ConfigureServices(IServiceCollection services)
{
services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
{
builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
}));
// ...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseCors("MyPolicy");
// ...
}
1.js:
export function a (){}
2.js: