- [OPTIONAL] Modify
src/main.tsto enable CORS:
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
await app.listen(process.env.PORT || 3000);
}| References: | |
| http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/ | |
| https://github.com/cyu/rack-cors | |
| http://nelm.io/blog/2011/11/cors-with-sencha-touch/ | |
| http://jessehowarth.com/2011/04/27/ajax-login-with-devise | |
| ============================================================================================================= | |
| GEMFILE | |
| ============================================================================================================= | |
| gem 'rack-cors', :require => 'rack/cors' |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |